Mutation is difficult to manage *in the large* and deserves careful annotation. Const doesn't help with this. 3/
7/7: Your code will be clearer and you won't have given up an important source of user intent.
-
-
I’m guilty of using “const” everywhere I can out of habit, but I doubt it has really ever prevented a bug.
-
It also devalues the meaning of const when you wrote it for a reason ("don't change this module-level variable plz")
-
In rust that kind of change is a public API-breaking change so people are more intentional about it.
-
I really want const to mean "the author thought this variable shouldn't be mutated" not "it happened to not be mutated".
-
I can tell the latter by looking at the code. The former is lost forever.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.