Exceptional coding style

Xinok xinok at live.com
Mon Jan 14 13:58:12 PST 2013


On Monday, 14 January 2013 at 19:24:25 UTC, Walter Bright wrote:
> Quite a nice read on the coding style used in Doom.
>
> http://kotaku.com/5975610/the-exceptional-beauty-of-doom-3s-source-code?post=56177550

I think more important than any aspect of a particular coding 
style is that style guidelines ensure that code is written in a 
consistent manner. The advantage is that, even if it's a "bad" 
style, you can learn to read and write code in that style which 
makes things predictable. You learn conventions which tell you 
how to use classes and functions without the need to refer to 
documentation. When convention isn't enough, you learn where to 
find the information you need (can it be inferred from the code? 
is it clearly stated in a comment or documentation?). If nothing 
else, you simply learn to read and interpret code written in a 
certain style.

It's certainly to the benefit of developers to have a good coding 
style. But the only thing worse than a bad coding style is a mix 
of styles which makes code inconsistent and unpredictable. There 
needs to be a consensus among the developers on a style guideline.


More information about the Digitalmars-d mailing list