Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
theuser481570doh boy another one, eh? Just what everybody wanted.
Oktokolo74170dJust never use the equality operator, remember, that all numbers are floats and that the most mathematical implementation of min and max is to have an initial value of -/+ infinity.
We can agree on that most of the implicit type conversations should be errors instead.
AlgoRythm4639070dMost of these (highly reposted) things are just a deliberate use of valid mechanics to get weird results.
The only one I find funny is typeof NaN. It makes sense, but still kinda gets me.
theuser481570d@AlgoRythm and it doesn't get better if you don't know how the type coercion system works. The statement (! +  +  + !) simply equals the string "truefalse" and whaddaya know, the length is 9.
> ! +  = true
> true +  == "true"
> "true" + ! = false
> "true" + false == "truefalse"
C0D45681570dNow for all the ones you are -using-... I mean abusing type coercion for, show me a valid use case that you are dumb enough to implement these with.
I'm waiting for the day someone actually uses "(!+++)" and expects a valid response.
Just because a language "can" do something, doesn't mean you as the dev "should" do it.
I mean, in simpler terms....
I "can" drive a car off a cliff into a valley of ass raping gorilla's, doesn't mean I "should"... unless you're into that that?, stop blaming the car.
hashit112670djs will most likely be hated by backend devs who rely more on logic , consistency and stability ..and loved by frontend devs who spend 4 hours deciding the colour of a button.
rooter21226dMost programmers make a few of those mistakes once or never and move on with life