Gentoo Archives: gentoo-dev

From: Stuart Herbert <stuart@g.o>
To: azarah@g.o
Cc: vapier@g.o, Gentoo-Dev <gentoo-dev@g.o>
Subject: Re: [gentoo-dev] Some 'proper coding' notes for ebuilds
Date: Sun, 03 Aug 2003 18:09:05
Message-Id: 200308031907.02960.stuart@gentoo.org
In Reply to: Re: [gentoo-dev] Some 'proper coding' notes for ebuilds by Martin Schlemmer
1 'lo Martin,
2
3 On Sunday 03 August 2003 4:18 pm, Martin Schlemmer wrote:
4 > On Sun, 2003-08-03 at 16:55, Stuart Herbert wrote:
5 > > On Sunday 03 August 2003 3:34 am, Mike Frysinger wrote:
6 > > > (2) do not use spaces for indenting ... tabs are the standard
7 > >
8 > > Then the standard is broken, and needs updating.
9 >
10 > Reasoning ?
11
12 Because, in any non-trivial piece of code, indents can end up being a mixture
13 of tabs and spaces, rather than just tabs. When this happens, and you use a
14 different tab size to the author, the indented code suddenly becomes a tad
15 unreadable.
16
17 This page puts it a bit better (and stronger ;-) than I can:
18
19 http://www.jwz.org/doc/tabs-vs-spaces.html
20
21 Additionally ...
22
23 There's no value in insisting on a particular indenting scheme. A good coding
24 standards document is a collection of technical review points to reduce the
25 number of defects that make it into a source control system. If a proposed
26 standard has no effect on the defect rate, it doesn't belong in the coding
27 standards document. Period.
28
29 (Stuff like epatch over patch technically belongs in the design standards
30 document - but it's common for design and coding standards to be combined
31 into a single document out of ignorance).
32
33 And, seeing as there's no formal peer review of code committed to CVS anyway,
34 <strong emphasis>you have no mechanism to enforce the entireity of any
35 proposed standard</emphasis>. Pitch the standard at stuff that actually
36 makes a difference (like epatch over patch).
37
38 If you really want to enforce an indentation standard, run CVS checkins
39 through indent or something. Automate the mother. That's how many
40 commercial organisations manage that type of problem.
41
42 Sorry, I've been handling these issues for too many years in the day job.
43 I'll take my SCM hat off now ;-)
44
45 Stu
46 --
47 Stuart Herbert stuart@g.o
48 Gentoo Developer http://www.gentoo.org/
49 Beta packages for download http://dev.gentoo.org/~stuart/packages/
50
51 GnuGP key id# F9AFC57C available from http://pgp.mit.edu
52 Key fingerprint = 31FB 50D4 1F88 E227 F319 C549 0C2F 80BA F9AF C57C
53 --

Replies

Subject Author
Re: [gentoo-dev] Some 'proper coding' notes for ebuilds Mike Frysinger <vapier@g.o>