4 ms·
I do not understand the benefit of making a variable immutable. How do you do for loops then? If I am not mistaken PHP introduced the goto statement just recen
by caramboleyo 4y ago
I do not understand the benefit of making a variable immutable. How do you do for loops then?
If I am not mistaken PHP introduced the goto statement just recently.
- schwartzworld 4y ago> How do you do for loops then? Take a look at JavaScript for-of loops or the various array methods in JS. As to the benefit of immutability, it removes a lot of the mental overhead from programming. Once a variable is set, you know it's value will never change. This eliminates lots of sources of bugs.
- abudabi123 4y agoThere are fewer syllables in "constant" than "immutable variable".
- schwartzworld 4y agoCool but kind of irrelevant since they aren't the same thing. https://softwareengineering.stackexchange.com/questions/149555/difference-between-immutable-and-const https://softwareengineering.stackexchange.com/questions/1495...