Basic coding style

Matthias Walter xammy at xammy.homelinux.net
Tue Nov 23 05:58:36 PST 2010



On 11/23/2010 12:12 AM, Jonathan M Davis wrote:
> On Monday 22 November 2010 21:03:27 Walter Bright wrote:
>   
>> Matthias Walter wrote:
>>     
>>> What about adding a compiler switch that one can turn on and that warns
>>> on obviously wrong names? Is this realistic? At least to check the usage
>>> of underscores and captial first letter. The CamelCase can probably not
>>> be verified, but hopefully a lot of programmers will use it, if the
>>> compiler encourages them to not use underscores... Just an idea, you can
>>> flame on, if you like.
>>>       
>> If you want, it would be easy to write a simple program that read the .json
>> output of the compiler, and then enforce any naming convention you need.
>>     
> That could be a useful tool. And I do think that a basic set of "typical" D 
> naming conventions and the like could be useful. But I don't really think that 
> it makes sense to have the compiler itself enforcing style. That sort of thing 
> definitely belongcs in external tools.
>   
So we should talk to the IDE designers, s.t. they include this into
their list of planned features. I recommend a 3-minute alarm sound per
badly named variable/function :)

Matthias


More information about the Digitalmars-d mailing list