New answers tagged

0

It is indeed good practice to declare variables as const (or readonly or final, depending on the language) if possible. The author of the linked answer also admits that is is right to mark variables as final, but the author is simply too lazy to do it. Even if the authors opinion about "clutter" was right, then it wouldn't apply to JavaScript or ...


4

*sigh*... This is why immutable needs to be the default. Even the referenced Java answer suggests this. Note that that answer does not recommend removing final modifiers, just that the author of that answer wouldn't add them in new code (for local variables) because they "clutter up" the code. However, there is a difference between JavaScript and Java ...



Top 50 recent answers are included