D naming style?

Christopher Wright dhasenan at gmail.com
Fri Sep 4 21:51:37 PDT 2009


Jarrett Billingsley wrote:
> On Fri, Sep 4, 2009 at 9:18 PM, Ali Cehreli<acehreli at yahoo.com> wrote:
>> Thank you!
>>
>> Jarrett Billingsley Wrote:
>>> Many people don't indicate class members with any kind of decoration
>> I noticed that too. :)
>>
>> The justification that I've come up with is that, we need the decoration in e.g. C++, because the member declaration is not visible in the implementation file, so the decoration communicates that the member is in the header file.
>>
>> That's not the case in D, so there is no need for the decoration; but I miss them too. :)
> 
> I'm consistently confused by D (and Java and C#) code that doesn't
> indicate member names, especially when they're named really common
> things that often conflict with local variables, like "len" or "src"
> or such. Unless the type is small enough to fit on a single screen,
> it's easy to forget the member names.

Most of the code I write uses classes that fit in one screen (20 lines 
or so) and still prefixes private fields with an underscore. It's 
convenient when initializing fields from constructor parameters.



More information about the Digitalmars-d mailing list