Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



That's fair, but PHP has the same level of WTF, and is (I'd argue) less elegant than JS.


Sorry, I'm missing something. Is the grandparent a big advocate of PHP? Why is PHP being brought into this?


It'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.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: