Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
retoor121771yI nearly can't imagine a case that going wrong. if(number) works exactly as if(bool). Enlighten me
-
To be fair, lots of other languages have this, too.
JS takes many of the worst aspects of other languages, combines it with some specific idiotic novel ideas, takes off its "scripting language" label and cheekily replaces it with a "programming language" label.
And then it proudly presents itself as the most popular language. Because popular means good, obviously. -
retoor121771y@Lensflare while writing a language myself I had many side effects what is considered functionality in python / js. Or like in Rust for example, last var get always returned. I got that functionality for free!
-
You can imagine how many of the details of unwanted side effects of some design decisions got forgotten and confused over time and ended up being promoted as nice features by devs with Stockholm syndrome who are held hostage by their favorite language.
-
msdsk31821y@Lensflare
Not to mention that the web has to be backwards compatible because of course so we are stuck with all those idiotic decisions -
I literally have to keep in mind to parseInt a value that I want to be taken as an integer.
I don't trust JavaScript. -
retoor121771y@SidTheITGuy people that passing integer to html attributes can *** in a fire. Always format. I never had unexpected values
-
@retoor I mean more in this way -
if (number > 0) lets say number is dynamic
so i do
if(parseInt(number) > 0) cuz who knows JS will take it as boolean.
It's more towards an internal logic that has to be written. -
@Lensflare "Because popular means good, obviously."
We need to find the fucker who invented the whole idea, tie him to a chair, beat him with hammers, and leave him bleeding in the moonlight.
I've been working with JavaScript for nearly a decade now and yet I still get fooled from time to time by the fact that 0 == false.
rant
javascript