Exceptional coding style

Russel Winder russel at winder.org.uk
Tue Jan 15 10:11:46 PST 2013


Andrei,

On Tue, 2013-01-15 at 12:09 -0500, Andrei Alexandrescu wrote:
[…]
> In book code samples you need frequently to align things vertically 
> (e.g. comments):
> 
> int a = 42;   // the meaning of everything
> a += 0.1;     // error! cannot assign double to int

That sort of alignment is nigh on impossible in a proportional font
using listing or minted. Of course there is no association between the
comments so no reason why they should align.  Tab alignments definitely
a bad idea for import by reference material.

> > I'll bear Bitstream Vera in mind for the book I am just starting.
> 
> Hope it's a book on D :o).

No it isn't. But it would be good if there were more books on D in the
market.

> > I use the one true kitchen sink, Emacs, mostly. Using Ocean Sans Std.
> > Eclipse, PyCharm, IntelliJ IDEA, NetBeans, GEdit, all using Ocean Sans
> > Std.
> 
> Guess I'll just try it!!!

Definitely give it a go.

You can set things using the menu system and writing the default fonts
out, or you can edit ~/.emacs.d/custom.el manually. This latter is the
properly hardcore programmer approach, but does require knowing a little
e-lisp.

(custom-set-variable
	…
 '(default-frame-alist (quote ((height . 40) (width . 120) (foreground-color . "black") (background-color . "#d0c4b0") (cursor-color . "red") (pointer-color . "red") (vertical-scroll-bars . right) (font . "-monotype-Ocean Sans MT-medium-r-normal--*-100-*-*-*-*-iso10646-1"))))
 '(initial-frame-alist (quote ((height . 40) (width . 120) (foreground-color . "black") (background-color . "#d0c4b0") (cursor-color . "red") (pointer-color . "red") (vertical-scroll-bars . right) (font . "-monotype-Ocean Sans MT-medium-r-normal--*-100-*-*-*-*-iso10646-1"))))
	…
)

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130115/742e713b/attachment.pgp>


More information about the Digitalmars-d mailing list