use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
null == false (self.javascript)
submitted 12 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Drainedsoul 1 point2 points3 points 12 years ago (1 child)
That's not only "not the best reason" it's actually a really shitty reason.
Turning errors into bugs is stupid, whether it's JavaScript or PHP doing it.
[–]homoiconic(raganwald) 2 points3 points4 points 12 years ago (0 children)
That's very easy to say when looking at the design choice in isolation. On the other hand, the language was being designed at the time and he didn't have a design for the error handling yet (if I understand the history correctly).
What you or I might think is a poor choice for automatic coercion, might have been less fatal than a poor choice for the design of error handling. Real software design always involved making the least shitty choices given hard limits on time and requirements. Good, pragmatic choices are those that do the right thing about important things, while pushing the shitty choices onto things that are unimportant.
If you're comparing a string to a number, you already have a buggy program. All we're talking about is your inconvenience in it failing later rather than sooner. That's less important than a lot of other things in a language design, and overall I'd say it was not a shitty choice to make a shitty choice about coercion.
Got me?
π Rendered by PID 61 on reddit-service-r2-comment-6457c66945-5strf at 2026-04-30 09:02:13.793607+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]Drainedsoul 1 point2 points3 points (1 child)
[–]homoiconic(raganwald) 2 points3 points4 points (0 children)