Inconsistent coding style in code examples

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 10 13:20:23 PST 2015


On 2/10/2015 12:57 PM, H. S. Teoh via Digitalmars-d wrote:
> Walter's reason for this is that 4-space indentation makes it look bad
> on Kindle and other small-screen readers.

My Kindle 3 has a 37 character screen width when using a monospace font (i.e. 
code font). Trying to read code formatted to 80 columns on it is just awful. 
While I don't expect anyone to read Phobos source code on a Kindle, I do expect 
the ereader version of the documentation to be read on the Kindle (or phone or 
whatever ereader).

Vertical space is also far more important on the small screen.

Having a different whitespace convention for documentation makes sense.

(Such constraints also come in to play when writing books and articles.)

At one point I had done this for all the examples in the D language spec, but 
I've never done it for the Phobos docs.


More information about the Digitalmars-d mailing list