Some languages are whitespace-sensitive, some are not, but in all of them we indent our code.
Why do we do this? To make our programs look readable. To structure them. To separate logical blocks, and collocate items that belong together.
But recently I encountered an interesting indentation pattern. It was in the C sources of an implementation of the OCaml language virtual machine.
(I'll just add a couple of paragraphs, so that "Recent updates" div doesn't make the indentation really ugly.)
(Yes, you should also have a screen wide enough. If you see a messy crap down there, just maximize your browser window, and stretch it beyond the screen border if even that doesn't help.)
Here's an excerpt:
Wonderful, isn't it? This source file has more of that:
I find the alignment of these Asserts and "Case N" comments very beautiful and "mathematical". It provides even more separation of different parts of the code. But not only it's useful, it also makes me want to print the code, set it into a frame and stare at it, smiling.
Author Paul Shved
Modified October 23, 2010
License CC BY-SA 3.0