Code Style

Lutger lutger.blijdestijn at gmail.com
Fri Jun 15 17:25:03 PDT 2007


Robert Fraser wrote:
> Hi all,
> 
> Right now, I'm working on a code formatter for the Descent IDE (http://www.dsource.org/projects/descent ), and I'm planning to make a (or possibly more than one) "default" profile for code style. All this stuff will be configurable down to the tiniest detail (if you want spaces before the comma but not after in superclass/interface lists and after the comma but not before everywhere else, that'll be evry possible), but having some sensible defaults would be a good thing. 

I'd think it is better to have a couple of defaults, codeblocks for 
example does this. It's too personal anyway.

I use something like BSD style except no curly braces for single line 
scopes (if, else, foreach, ...):
http://www.prowiki.org/wiki4d/wiki.cgi?CurlyBracePlacement

If I had to pick two, I would support BSD and Stroustrup style of the 
above link, they seem to be the most common.

I've used a formatter once or twice to make someone elses code more 
readable (in my eyes), and perhaps if this thing will be so flexible I 
may use it to force some consistency upon myself.






More information about the Digitalmars-d mailing list