A collection of DIPs

Idan Arye via Digitalmars-d digitalmars-d at puremagic.com
Mon Sep 7 14:11:10 PDT 2015


On Monday, 7 September 2015 at 16:10:31 UTC, Israel wrote:
> On Monday, 7 September 2015 at 14:44:05 UTC, nx wrote:
>> https://github.com/NightmareX1337/DX
>>
>>> Destroy!
>
> Yea ill admit, i came from C# and i hate underscores. I prefer 
> PascalCase above anything.

3 of the keys in my keychain are of the same brand, so they are 
shaped pretty much the same. The pin arrangement is different, of 
course, but they all have similar blades of the same height and 
width, and plastic-cased bows of the same rectangular shape.

The orange key opens the front door. The yellow key opens the 
back door. The blue key opens the old bicycle storage room.

I prefer the looks of the blue key. The shape is the same, but 
the color does make a difference - the orange and yellow ones 
look kinda toyish - the colors "scream" too hard. The blue one 
looks professional - as much as a key can look professional.

Still, I wouldn't want them all to be blue

Because then I wouldn't be able to tell the freaking difference!


Maybe you think PascalCase is the best case. Maybe you are right, 
and there is an objectively "best" case, which is better than all 
the rest. It doesn't matter - the problem is not which single 
case you choose to rule them all, but that you insist on choosing 
one and making the convention to use only it for everything you 
define.

At the very least, the convention should specify two cases - for 
types and for variables(=fields/arguments/scoped variables) - 
because you want to be able to name variables after their types. 
This might be considered a bad practice for the built-in types, 
but with user defined types you can usually get the type specific 
enough and the scope small enough for this to be the natural 
choice.

The C# standard library is filled with member fields named after 
their types, and since both type and field use PascalCase, they 
had to use separate namespaces for types and variables.

Now, for a language that has context sensitive keywords having 
context-sensitive identifier namespaces is not that weird - but I 
really don't want to see this misfeature in D...


More information about the Digitalmars-d mailing list