Basic coding style

Jonathan M Davis jmdavisProg at gmx.com
Mon Nov 22 21:12:24 PST 2010


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.

- Jonathan M Davis


More information about the Digitalmars-d mailing list