Exceptional coding style

renoX renozyx at gmail.com
Tue Jan 15 06:32:43 PST 2013


On Tuesday, 15 January 2013 at 11:43:20 UTC, Simen Kjaeraas wrote:
> On 2013-58-15 11:01, Russel Winder <russel at winder.org.uk> wrote:
>
>> On Mon, 2013-01-14 at 11:24 -0800, 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
>>
>> On the other hand I don't like some parts of the style he is 
>> putting
>> forward as good.
>>
>> Go has an extreme position on this, there is one and only one 
>> style of
>> code that is acceptable, the one defined in the gofmt program 
>> that is
>> used to format all Go code. I happen not to like some parts of 
>> it, but I
>> live with the enforced style.
>>
>> Python is less extreme, in that there are many styles of code 
>> allowed,
>> but there is PEP-8 which is "Python style as Guido intended".  
>> This is
>> supported by the pep8 program for enforcing elements of style. 
>> I have
>> disagreement with some of the choices, but I live with it, and 
>> format my
>> code to PEP-8 except for the line length rule – which is just 
>> so 1980s.
>>
>> C, C++, D, Fortran, Groovy, probably need to learn a lesson 
>> from one or
>> other of these.
>>
>> The issue is that having a single global style standard for a
>> programming language makes it easier to read code in that 
>> language.
>
> I agree a canonical form could be nice. Even so, I am firmly of 
> the
> opinion that such should not be forced upon programmers. 
> Prettifiers certainly can help here.

Not really; prettiffiers works for 99% of the code and mess the 
remaining 1%, that's why it is better to "force" programmers to 
use one style and not relying on a tool..



More information about the Digitalmars-d mailing list