Background on Coding Style

Setting up an efficient and effective environment for software development requires some effort. A minority of developers tend to give up early and propagates its frustration on the Internet through pessimistic advice, which can be summarized as 'an ASCII-art image is be the safest coding style'. Luckily text recognition from bitmaps is not supported by compilers, so they can't suggest that option. Don't fall into the trap of painting images, whether ASCII-art or bitmaps. Taking out flexibility only makes life difficult for others.

1) The files of this project are maintained with text editors using monospace fonts. Typography tells us that such fonts require a larger line-spacing for readability. It is an important setting and the first to get right. Even the GUI version of emacs has an option for more eye-friendly monospace fonts, e.g. (line-spacing 5). If your favourite editor doesn't offer this important feature, try finding a readable font with a larger line-spacing built in.

Inserting empty lines instead of increasing the line spacing is painting ASCII-art. It removes the flexibility for other developers to configure their idea of how much line spacing is most readable. One can only guess whether K&R had a proper font (monospace, large) and an enlarged line spacing, but it seems plausible if you look at their style. They keep the opening brace on the same line, because there is already so much of space around the 'print'. Not on your display? Do yourself a favour and fix it.

	if ($some eq $other) {
		print 'Hello World';
	} else {
		print 'Bye World';
	}

2) An efficient programmer does non-linear editing during development, because the nature of most changes is non-linear. The ability to navigate through code without reading it character-by-character or line-by-line is a virtue of a good programmer. Code has to be arranged in visually outstanding blocks to support the programmer with the non-linear editing. The whole idea about indentation is to create such visually outstanding blocks. Outstanding means, a block can be recognized instantly and without a time-consuming count of opening or closing braces.

In this project indentation is created by indentation characters ('tabs'), because they were - least surprising - invented for that purpose. Indentation characters allow the individual programmer to specify what is visually outstanding on the screen without affecting other programmers. The concept of indentation by keypress is as old as mechanical typewriters, has found a control character in the computer world and works well with major text editors. 

Again, using spaces instead of indentation characters is painting ASCII-art and takes away options from others.


3) The document /usr/src/linux/Documentation/CodingStyle contains a lot of useful suggestions and last but not least the manual page perlmodstyle gives Perl-specific advice.