[vtk-developers] style : Holiday greetings and a present of VTK4.0
Simon Warfield
warfield at bwh.harvard.edu
Fri May 25 07:34:45 EDT 2001
On Fri, May 25, 2001 at 09:25:27AM +0530, Prabhu Ramachandran wrote:
> This is pretty amazing, all of us seem to like this way of using
> blocks.
>
> if (condition) {
> do something;
> }
I like this brace positioning style too, and I like to bracket single
statement if blocks because it makes it easy to add a second line to e.g.
print something out while debugging.
See commandment 8 at http://www.plethora.net/~seebs/c/10com.html
8. Thou shalt make thy program's purpose and structure clear to thy
fellow man by using the One True Brace Style, even if thou likest it
not, for thy creativity is better used in solving problems than in
creating beautiful new impediments to understanding.
These words, alas, have caused some uncertainty among the
novices and the converts, who knoweth not the ancient wisdoms.
The One True Brace Style referred to is that demonstrated in
the writings of the First Prophets, Kernighan and Ritchie.
Often and again it is criticized by the ignorant as hard to
use, when in truth it is merely somewhat difficult to learn,
and thereafter is wonderfully clear and obvious, if perhaps a
bit sensitive to mistakes.
While thou might think that thine own ideas of brace style lead
to clearer programs, thy successors will not thank thee for it,
but rather shall revile thy works and curse thy name, and word
of this might get to thy next employer. Many customs in this
life persist because they ease friction and promote
productivity as a result of universal agreement, and whether
they are precisely the optimal choices is much less important.
So it is with brace style.
More on the 1tbs at http://www.jetcafe.org/~jim/c-style.html
--
Simon
More information about the vtk-developers
mailing list