this post was submitted on 05 Sep 2023
911 points (98.7% liked)
Programmer Humor
19544 readers
709 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
This is due to the default sorter in JavaScript sorting by the string value. The reason for that is that this won't create errors at runtime. Since JavaScript does not have types, this is the safest way of sorting.
This works:
Which is a fine decision if you have a programming language to do silly stuff on a personal geocities page, but a horrible one when you start using that language to handle serious data. Silently ignoring what's probably a bug is dangerous.
And that is, of course, what it was designed for.
JS is brilliant considering that it was created by one dude in 10 days. Nobody thought it would become nearly as important as it has become.
Get out of here with your sensibility!
^kidding, ^js ^via ^ts ^is ^my ^life.