▲ | pcwelder 16 hours ago | |||||||
>if they don't whatever happens, happens What happens is you get an error. So you immediately know something is wrong. Javascript goes the extra mile to avoid throwing errors. So you've 3>"2" succeeding in Javascript but it's an exception in python. This behavior leads to hard to catch bugs in the former. Standard operators and methods have runtime type checks in python and that's what examples in the article are replicating. | ||||||||
▲ | recursivecaveat 15 hours ago | parent [-] | |||||||
It's so strange to me that JS goes so far to avoid errors, mashing random stuff into strings or NaNs, misspelled variables just become undefined, etc. Then when your off-the rails program reaches `undefined()` it's "woah woah woah, that's clearly nonsense, stop program execution right this instant". I feel like I could respect it a little more if they committed to "a webpage should never crash under any circumstances" and there were just no exceptions in the language whatsoever. | ||||||||
|