2 ms·
> just like we use const instead of typing out constant. Those aren't constants†, they're immutable variables which are quite different. Because of the "as if"
by tialaramex 3y ago
> just like we use const instead of typing out constant.
Those aren't constants†, they're immutable variables which are quite different. Because of the "as if" rule and provenance in some cases you get the same benefit as with a real constant, but that's not what this is.
† In C or C++. In some other languages const does, logically, get you an actual constant.
- pkkm 3y agoUnless you think that the abbreviation const stands for some other word than constant, I'm not sure how that's relevant here?
- tialaramex 3y agoBecause these aren't actually constants it would actually be even worse if the keyword was "constant" rather than "const". Jargon that's identical to ordinary words but is just plain wrong if taken that way makes it harder to be understood. In a language where the const keyword gets you an actual constant this condition wouldn't arise.