3 ms·
This is not "WHY", this is "HOW exactly". I bet the reason why JavaScript has these behaviors is due it being developed as a browser scripting language. Authors
by gambler 15y ago
This is not "WHY", this is "HOW exactly". I bet the reason why JavaScript has these behaviors is due it being developed as a browser scripting language. Authors didn't want the entire script terminating because some part of it was buggy. This could have been handled by some clever isolation and error-recovery mechanism, but it wasn't. Probably due to time constraints.
These kinds of things are one of the reasons why I really don't like the idea of everything (including server-side and standalone apps) being written in JavaScript.
- pfraze 15y agoThat's fair, but PHP has the same level of WTF, and is (I'd argue) less elegant than JS.
- archgoon 15y agoSorry, I'm missing something. Is the grandparent a big advocate of PHP? Why is PHP being brought into this?
- pfraze 15y agoIt's a language that is heavily used for server apps, which the top post was saying JS shouldn't do. My point was, quirks like these haven't outweighed the advantages of PHP, and I don't think they should for JS either.
- deleted 15y ago[deleted]