enum and const or immutable ‘variable’ whose value is known at compile time

Mike Parker aldacron at gmail.com
Thu Sep 17 10:53:48 UTC 2020


On Thursday, 17 September 2020 at 09:44:20 UTC, claptrap wrote:

>
> Names are important, principle of least astonishment and all 
> that, pretty much everyone coming to D is going be WTF in 
> learning about that. And if you keep overloading existing 
> keywords with more and more meanings the code gets harder and 
> harder to grep at first glance.

I can attest that in the 17 years I've been hanging around here, 
the fact that enum is used to indicate a manifest constant has 
not been a serious source of WTF posts. So I think "pretty much 
everyone coming to D" have decided it's either perfectly fine or 
perfectly tolerable. It's the sort of thing that may not be 
obvious, but once you figure you absorb it and get down to 
coding. I know some people would prefer it were something else 
and some don't care. I'm squarely in the camp that thinks it 
makes perfect sense and it would be silly to create a new keyword 
for it.


More information about the Digitalmars-d-learn mailing list