Exceptional coding style

dennis luehring dl.soluz at gmx.net
Fri Jan 18 01:45:46 PST 2013


Am 18.01.2013 10:29, schrieb Jonathan M Davis:
> Formatting can have a huge effect on code legibility. There are plenty of cases
> where slight formatting changes don't make that big a difference, but some
> really can (e.g. where the braces go), and many small differences can add up.
> For instance, I've known folks who used lots and lots of parens (generally not
> relying on operator precedence at all), and that made the code_much_  harder
> to read. Or having too much or too little whitespace can have a large effect on
> how the code looks and how easy it is to read. It's a_highly_  subjective
> issue, but I think that it's misguided to think that code formatting doesn't
> matter. True, the semantics matter more (if nothing else, semantics matter to
> the compiler, whereas formatting doesn't), but it still matters quite a bit.

don't get me wrong - coding style is very very important

but without an forced formatting standard you got following problems:

-many different coding styles in each company, sometimes even on 
deparment-level, every project
->hard for project jumpers, always a need for everyone to define a standard

coding style itself: _highly_ subjective emotional thing mostly hard to 
discuss in any way
->a forced standard could de-emotionalize the them a little bit

-permanent reformatting when integrating foreign code

a forced coding style could help to define a better base standard that 
many will just use because of its existence

etc...


More information about the Digitalmars-d mailing list