Implicit enum conversions are a stupid PITA

Nick Sabalausky a at a.a
Fri Mar 26 21:31:11 PDT 2010


"Walter Bright" <newshound1 at digitalmars.com> wrote in message 
news:hojjk3$3ch$1 at digitalmars.com...
> Andrei Alexandrescu wrote:
>> On 03/26/2010 06:26 PM, Walter Bright wrote:
>>> KennyTM~ wrote:
>>>> On Mar 26, 10 11:32, Walter Bright wrote:
>>>>> Nick Sabalausky wrote:
>>>>>> Supporting it means it will "silently and disastrously break code"
>>>>>> from anyone who tries to use a leading zero and *isn't* a C guru,
>>>>>
>>>>> You don't need to be a guru to know that. I was once a C newbie, and
>>>>> never had any trouble with it.
>>>>>
>>>>> It isn't just C, either, the same syntax is used in C++, Objective-C,
>>>>> Groovy, M4, Clojure, Go, Java, Scala, Javascript, PHP, Ruby, bash,
>>>>> Python (2.6 and earlier) and Perl.
>>>>>
>>>>> (It is not used in C#, Python 3.0, Fortran, or VisualBasic.)
>>>>
>>>> And removed in ECMAScript 5 (next standard of Javascript).
>>>
>>> I didn't know that. But still, it's hard to be a programmer and not use
>>> a language that has such literals.
>>
>> http://en.wikipedia.org/wiki/Argumentum_ad_populum
>
> I was responding to Nick's argument:
>
> ------------------------------
> Supporting it means it will "silently and disastrously break code" from 
> anyone who tries to use a leading zero and *isn't* a C guru, and very few 
> people these days are (I used C for years without being aware of that 
> octal syntax - it's only by dumb luck I didn't try to use a leading zero).
> -------------------------------
>
> where the statement of very few people being exposed to such literals is 
> the issue. I should have left in the fuller quote.

Using a language that has 0xxx-style octal literals and actually being aware 
of it are two different things. And I'd say that my assumption it was only C 
speaks to its obscurity.





More information about the Digitalmars-d mailing list