3 ms·
> I don't like using exported variables as final values, so I need to use functions to return the final values, which is verbose and not elegant. Lacking of rea
by chooseaname 7y ago
> I don't like using exported variables as final values, so I need to use functions to return the final values, which is verbose and not elegant. Lacking of read-only values also causes some unnecessary performance losses.
This sounds like you're fighting against the language. I think a lot of developers do this. I think one should either embrace the language or find another (you did mention moving to C++).
- tapirl 7y agoI do this to adapt it, to make code more secure and serious. I embrace other features in Go but not this one. This one makes Go some like a non-serious language.
- AnimalMuppet 7y agoIn what way does it make Go "non-serious"? And, why do you care? I care about the suitability of a language for the problem I'm trying to solve, not it's "seriousness". What concrete difference does this make to programs that you're writing?
- tapirl 7y agoVariables means modifiable. Using variables as final values is bad. This is so simple that no explanations are needed.