Re:Why MD5('240610708') is equal to MD5('QNKCDZO')?
by eyelidlessness on Wednesday April 12, 2023 @05:30PM
(#35547244)
This is surprising to me! I/my team do use such a linter rule (non-strict equals errors for all cases except directly comparing to null), and I don’t even notice it while reading code because the linter is satisfied, and because it reads as (obviously, to me) correct.
It never occurred to me that it could be so noticeable to others as to add any cognitive overhead. I’m not discounting that at all, to be clear, only that it’s not something I’d ever considered before now.
Re:Why MD5('240610708') is equal to MD5('QNKCDZO')?
by fuckingbonkers on Thursday April 13, 2023 @12:39AM
(#35551020)
We have banished it as well for this exact reason — the “toll” — if you want 1 more piece of anecdata.
Just because of that I've created an `isNil = (x) => x is undefined or null` function and banished == from my code.
== can lead to what we've jokingly called tollbooth code: code that can make every reader stop and pay a mental toll while they confirm that the writer did intend to write the code that way.