|
|
|
|
|
by AnimalMuppet
2081 days ago
|
|
I deny that the example given counts as "broken". The expectation seems to be that, if a variable was created as the result of a function call with side effects, every use of that variable on the right-hand-side of an equals will result in an additional function call, with side effects. I suppose that that's mathematical equality, as defined in math papers, but we aren't writing math papers. Programmers would find that behavior to be much less useful than the current one. [Edit: I mean, I guess that the proposed approach allows "algebraic reasoning", which some people find helpful...] |
|
> but we aren't writing math paper
It's not about writing math papers, it is about having making refactoring less error prone. Imo, the equals from math helps this cause and it iw worth it.
The new approach may seem harder because we have been programming for 40+ years with side-effects, tracking them ourselves. It is understandable.