2 ms·
The vast majority of variables in your program won't be mutable or be changed around so why add the mental burden of mutability on every single variable just fo
by imtringued 4y ago
The vast majority of variables in your program won't be mutable or be changed around so why add the mental burden of mutability on every single variable just for some tiny minority of cases?
- izackp 4y agoIt doesn't have to be a mental burden.. Just write all your variables as mutable then let the ide automatically correct them to immutable. Ex: "Warning: This variable is never mutated. Would like to make it a const? <Fix>" Let's say it is a mental burden. I'd rather have the burden when writing the code over when reading the code. (https://news.ycombinator.com/item?id=31823991 https://news.ycombinator.com/item?id=31823991)