this post was submitted on 05 May 2025
407 points (98.8% liked)
Programmer Humor
23011 readers
1706 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 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Javascript could throw an error to alert you that the input is supposed to be a string, like most languages would do.
But you're calling a function specifically made for passing a string to an int... π There's gotta be some common sense somewhere here, guys.
Still, it's a very good point. JS should do this.
I would suspect one reason it doesn't do this is to be backwards compatible.
And god fucking forbid that common sense be in the language. Who the fuck needs a language with common sense, amirite?
π€ͺ
Theoretically, Javascript is an untyped language, so there aren't supposed to really be static types. Giving type errors in this situation would be against design.
Maybe the design is bad, then.
Lol you'll get no argument from me. It's not my favorite language.
JavaScript has types and it does have type errors, for instance
Please stop spouting nonsense on issues you know nothing about.
Dynamic types aren't static types my man. I think you got some learning to do.
You did say untyped though.
Lol like facilitate versus effectuate
Function only handles string arguments correctly. Wat.