3 ms·
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.
by sametmax 8y ago
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.
- 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.