Coding with Color

Historically, all of the code samples printed in MSDN Magazine and its predecessors have been monochromatic: black on green, black on white, black on grey, or something similar.  Every year we reconsider this, tossing around the idea of printing all of our code samples in full Visual Studio-like color, and invariably, we decide not to for the time being, giving precendence to other matters and projects.  It's that time of the year again, however, and I'm curious to know how important or welcome this would be to you, our readers.  Are you in any way hindered by the code as we print it, and would you benefit greatly if the code were printed in amazing technicolor?  Would you benefit from the code being in color online even if it remains as is in print?  All feedback is welcome.


Comments (5)

  1. Julian says:

    If you do go for colour, please ensure that you allow for those of us who are colour-blind. There are many combinations of colours that are effectively unreadable, whereas you can guarantee that black on white is readable.

  2. Honestly, until you mentioned I have never noticed that the code was in black/white or color.  That said, if it would cost alot more to put the code in color than I do not think it is worth it.

    Shaun McDonnell

  3. Ericga says:

    not worth it. Some people have problems with some hues. You can’t make a simple photocopy anymore without loosing lisibility, etc.

    Online is a different matter.

  4. Roland says:

    I have chosen my personal color style for the code editor the following way (I’d guess that would be ok on paper, too):

    Step 1: Black on white works best for reading, so by default text is black

    Step 2: There are some larger lumps of text that are different from code: strings and comments. So these get a different color

    Not exactly color-related, but maybe helpful nevertheless:

    – Use of a proportional font, e.g. Verdana. Monospaced is soo last century]

    – Code often contains IdentifierA.IdentifierB sequences. Price question: Is IdentifierA a class member or a class? Chosing bold font for class names helps here (on screen I use a very dark gray instead of black for bold text, it’s easier on the eyes).

    – Keywords in bold and blue are good, too

  5. Aaron says:

    The code is pretty secondary on the magazine so the coloring is a none issue.  On the website it would be nice.  Coloring gets a little more nice when its a long code example on the web. It just needs to be broken up a little.

Skip to main content