r/programminghorror
•
u/Leonnee
•
Jun 12 '25
•
1
Javascript Javascript is filled with horror
2.4k
Upvotes
View all comments
Show parent comment
27
u/Tyfyter2002 Jun 12 '25
In statically typed languages, you don't even have to read the documentation to find out what
Sortdoes, because it sorts the elements in the collection how they usually should be sorted, instead of just the only way they can definitely be sorted;Documentation should be for methods that don't have one implementation to blatantly obvious from the name alone that it would be idiotic to assume they function differently in any other language;
Imagine if
a + banda - bwere not just able, but likely to be completely unrelated operations based on factors which can easily vary by user input.