2 ms·
> If you are enough aware of the differences that you know you should use `===` Every beginner knows that because all recent books literally say "don't use ==,
by The_Colonel 5y ago
> If you are enough aware of the differences that you know you should use `===`
Every beginner knows that because all recent books literally say "don't use ==, use ===", modern IDEs will point it out for you and 1st code review feedback will point it out.
What usage of this moot point showcases for me is mostly author's blind bashing without real knowledge.
- marcosdumay 5y agoIf 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.
- The_Colonel 5y ago> 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.
- marcosdumay 5y agoYour 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.