3 ms·
> only that 'const' in C-family languages has significant drawbacks AFAIK this is pretty much limited to C and C++. Many (and I am willing to venture most, or
by chimeracoder 11y ago
> only that 'const' in C-family languages has significant drawbacks
AFAIK this is pretty much limited to C and C++. Many (and I am willing to venture most, or at least the most-used) C-family languages that aren't C/C++ don't suffer this issue. Go and Javascript, for example, both use "const" in a way that doesn't modify the type of the underlying object.
- bitwize 11y ago"C-family languages" here means C, C++, Objective-C and D -- not any of the "look-like-C-but-have-completely-different-semantics" languages, or Go which is probably closer to proposed C replacement Alef than to C itself.
- golergka 11y agoI think that the scope of this discussion is limited to C/C++. If a programmer doesn't like immutability as a broad concept, he is clearly an incompetent imbecile (and I'm trying to write that as polite as possible, given the severity of the issue).