News for hackers. Stuff that matters.
Re:Strengthening JavaScript by logicallee on Tuesday March 10, 2015 @05:50PM (#9180910)
isn't it like why you would remove asserts? the only thing an assert will do is fail (or do nothing) - why do you want to fail for users? (when you could not fail, or at least not on that line) - so they can see that you messed up?

It's kind of like protocols: be strict in what you send out but lenient in what you accept. be strict in the javascript you write but then lenient when your users are actually running it.

Re:Strengthening JavaScript by svachalek on Tuesday March 10, 2015 @06:08PM (#9181018)
A failed assertion means the program no longer has any idea what's happening. If it continues past that point it can either get lucky or start to do lots of damage. Whether that's an acceptable risk depends a lot on what type of program it is.
Re:Strengthening JavaScript by Igglyboo on Tuesday March 10, 2015 @06:15PM (#9181072)
What if you're writing HFT software and an error causes you to spend millions of dollars on the wrong thing? If you had that assert in there then the program would have just crashed instead of bankrupting your company.

Similar problems could easily arise in JS with e-commerce type applications, failing is sometimes a good thing.