News for hackers. Stuff that matters.
Re:W3schools.dev Redirects to Mozilla Developer Network by kevinsimper on Friday March 01, 2019 @11:23AM (#19282180)
I tried adding better examples for "alert"s for example, but my PR got not approved because it didn't fit the exact structure of how the wiki is structured. So they make it intentionally worse than w3schools :)

https://github.com/mdn/interactive-examples/pull/1266

Re:W3schools.dev Redirects to Mozilla Developer Network by TheRealPomax on Friday March 01, 2019 @11:35AM (#19282355)
<h1>how to use alert()</h1>

<p>see the Console API</p>

<footer>don't use alert(), don't talk about alert(), don't teach alert(), it's not 1997 anymore</footer>

Re:W3schools.dev Redirects to Mozilla Developer Network by sametmax on Friday March 01, 2019 @11:52AM (#19282576)
alert() is very handy to learn, as it gives the new commer something tangible and familiar to use for tests.

You just have to give proper context.

Re:W3schools.dev Redirects to Mozilla Developer Network by TheRealPomax on Tuesday March 05, 2019 @12:42AM (#19308369)
No, the console API is a handy thing to learn. Alert is not handy, it's an ancient function that (a) blocks your page thread, (b) can't show anything except `.valueOf`, (c) can't be selectively ignored, (d) it's an obsolete API from way back when javascript 1.5 was hot stuff.

If you're teaching, teach people to use console.log because that's where they're going to get REAL insight into what the code's doing (console.table you say? amazing!) and never look back. And if you're learning, demand people teach you modern practices. Not ridiculous things from 20 years ago.

Re:W3schools.dev Redirects to Mozilla Developer Network by jimsmart on Friday March 01, 2019 @12:39PM (#19283269)
> proper context.

That's not 'tests' — tests would be something like Mocha, or Jasmine — what you're actually talking about here is one of the many forms of ad hoc in-browser debugging.

Re:W3schools.dev Redirects to Mozilla Developer Network by yorwba on Friday March 01, 2019 @01:02PM (#19283554)
Automatic tests are not the only way to test software, nor are they sufficient. Whether some software can actually be used is not something that's completely formalizable and so you can't test it automatically. You always need a human in the loop in the end, and alert is a legitimate tool to effortlessly display some additional information on internal state during an interactive user test.
Re:W3schools.dev Redirects to Mozilla Developer Network by johnfn on Friday March 01, 2019 @01:08PM (#19283630)
> ad hoc in-browser debugging

Ah, if only there was a single word - a verb perhaps - that developers could use to colloquially refer to this process!

Re:W3schools.dev Redirects to Mozilla Developer Network by sametmax on Friday March 01, 2019 @02:58PM (#19284682)
Not testing the code, fidling with the stuff they are learning.