|
|
|
|
|
by ronaldx
4446 days ago
|
|
> Mathematicians are used to working with various equivalence relations, even in the same context. So if a modestly trained mathematician saw == and ===, she would immediately ask "what is the difference between these two ER's?". This perhaps illustrates my point. While you say == and === are equivalence relations (I would argue they are not), there is a wider problem. = itself is an assignment operator and should never be considered as an equivalence relation.
But it is normal to consider = as algebraic equality for anyone who has completed high school math. It's a great loss to intuitive understanding that we use = for assignment. If anything, considering Javascript's == and === is a net benefit as programmers are more acutely aware of the issue here. What percentage of time spent learning to program and recovering bugs is caused by overcoming this misintuition? It's surely a lot. Wikipedia has further discussion: https://en.wikipedia.org/wiki/Assignment_%28computer_program... |
|