D pullrequest review process rant

Russel Winder russel at winder.org.uk
Thu May 9 01:48:35 PDT 2013


On Wed, 2013-05-08 at 17:07 +0200, deadalnix wrote:
[…]
> When you read a lot of code, if the presentation is correct, it 
> disappear and the content become apparent. Otherwise, it is much 
> more work to get to the content.
> 
> Many project simply reject code that is not formatted properly. 
> Not kidding !
> 
> The solution is o provide a code formatter here, not to change 
> the review process.

The Go team have gone a stage further, not only will they not look at
code that is not properly formatted, neither will Go compilers.

They do have gofmt though which applies the style — which has some
fundamental faults, but you have to live with them or not use Go. This
has had the effect of retraining everyone using Go to use the global
style.

Python doesn't quite go this far, but there is PEP-8 which is Python as
Guido wants to see it formatted. There is a tool to support you getting
it right.

C used to have an informally accepted style (which was awful) and until
about 1981 all C code had the same style.

I have to admit the thing I really like about Go is the insistence on
using tab character for leading indent. Now that I have discovered how
to make tab display as 2 spaces instead of 8, I really like the lack of
discussion about how many leading spaces per indent level in the source
code. I would really like Python to have followed this rule.

Of course then you can bikeshed about whether the { goes on the end of
the line or on the next line.  Clearly the only sane place is the end of
the line, but many people hate that. And hate leads to suffering.

The positive lesson from Go is that application of one, and only one,
formatting style, backed up by a tool incorporated into the compiler,
does lead to the avoidance of bikeshedding and to community peace — just
not world peace.  
-- 
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/20130509/2d9f317a/attachment.pgp>


More information about the Digitalmars-d mailing list