4 ms·
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
by kevinsimper 8y ago
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 https://github.com/mdn/interactive-examples/pull/1266
- TheRealPomax 8y ago<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>
- sametmax 8y agoalert() 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.
- jimsmart 8y ago> 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.
- yorwba 8y agoAutomatic 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.
- johnfn 8y ago> 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!
- sametmax 8y agoNot testing the code, fidling with the stuff they are learning.
- TheRealPomax 8y agoNo, 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.