I would personally skip the color. While it certainly helps when writing code (the code color makes it easier to see the code structure at a glance, combined stuff like indentation, of course), I think that when teaching Perl, this will just clutter things up.

It depends on the level of the people you will be teaching, but beginning programmers tend not to differentiate between language statements (such as print) and programmer provided things (such as variables and function names). Putting these elements in different colors will not add to the clarity, I think, but add confusion.

In short, I think that coloring code for teaching purposes might not be ideal, especially if your public is not advanced enough yet to understand why various parts get colored similarily.

Then again, once your public knows why 'print' and 'while' are red, whereas '$variable' and 'function_name' are green, and for sufficiently large code, color does add clarity. Just don't do it too early and don't overdo it.

CU
Robartes- who's married to a teacher :)


In reply to Re: Documenting code by robartes
in thread Documenting code by traveler

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.