Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you only know "don't use ==, use ===", you will just fall for the next unityped trap. If you know why you shouldn't use `==`, you know enough so that even if you don't go for `===`, using `==` safely is the least of your problems.


> for the next unityped trap

Many languages are unityped and carry the same problems, yet they are hyped rather than bashed (e.g. Python, Ruby).

> If you know why you shouldn't use `==`, you know enough so that even if you don't go for `===`, using `==` safely is the least of your problems.

You have some weird false dichotomy going on. I'm personally in the state "I remember why == is bad (type coercion ...)" but I don't remember all the details to be able to use == correctly. I bet many people are in a similar situation.


Your two examples are not unityped, and most unityped languages are unityped all the way down and as a consequence do not have the same problems.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: