Implicit enum conversions are a stupid PITA

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Mar 25 16:21:16 PDT 2010


On 03/25/2010 06:11 PM, Walter Bright wrote:
> Andrei Alexandrescu wrote:
>> Then you'll be happy to start using octal as soon as I commit it.
>
> Haven't changed my mind about that, nor the reasons!

Haven't seen you posting the results of the grep. As "reason" has the
same root as "reasoning", there must be some of it aside from just
subjective preference. As such, there must be some way you could respond 
to this:

> Symbolic constants are the best way to deal with the filesystem.
>
> It's not at all hard to beat. It would be if octal constants would be
> ubiquitous and ubiquitously useful. To disabuse yourself of that
> fallacious notion, PLEASE grep ALL your code for
>
> [^0-9A-Za-Z."%_:\]0[0-9]
>
> and let us know how many instances you find.
>
> druntime has 152 octal constants for a total of 53130 lines. That's
> one for each 350 lines of code, or less than 0.3%. Ironically, most
> occurrences are used in defining symbolic constants that are good
> style for handling permission bits.
>
> For Phobos I counted 11 true positives in 93,963 lines, which means
> one per 8542 lines of code or 0.01% of total.


Andrei



More information about the Digitalmars-d mailing list