Exceptional coding style

Russel Winder russel at winder.org.uk
Tue Jan 15 02:58:47 PST 2013


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.
 
-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130115/dc3c81ea/attachment.pgp>


More information about the Digitalmars-d mailing list