
 Syntax Highlighting / Code Colouring - nickb
http://drinkbroken.typepad.com/drink_broken/2007/11/syntax-highligh.html
======
gills
I find it ironic that people who create technology to automate tasks in the
lives of others refuse to automate tasks in their own. I recall a group of
folks who once refused to use looms because it wasn't as "pure"...

I find syntax highlighting very useful. In fact, I use as much as I can. I
want to offload as many mental "maintenance" tasks to the computer as
possible, so I can concentrate on the real problems.

~~~
edw519
I prefer to do the mental maintenance tasks myself. Just like Tiger Woods hits
400 balls a day or Kobe Bryant shoots 1000 shots a day. I know my code like
the back of my hand so when I wake up at 3:00 a.m. with a thought, I don't
need a listing; I know. Nothing ironic about it.

~~~
gills
I respect your preference, so I will try to respond with some colloquial form
of reasoning.

Please forgive the slight abuse of information theory...in general, styled
text will have lower entropy than the same un-styled text. Low-entropy text
will be more memorable than high-entropy text because it contains more
information. It's like a chapter heading in a book - not only is it
interesting and informative, the style provides the context that it is a
heading and not the first sentence.

Re-reading my previous comment, one could misconstrue that my editor looks
like a crayon box. It doesn't. I use fairly subtle styles for most parts of
the text, with only a select few items in bold or bright styles (keywords,
constants). It helps to skews the distribution of what grabs my attention and
what does not.

------
mechanical_fish
"When Perl 6 arrives I'd like a two colour system that indicates whats a new
Perl 6 feature and whats an old Perl 5 feature."

This is one of the funniest sentences that I have ever read.

Is this satire? Or should I be even _more_ glad that I switched to Ruby than I
already am?

------
BrandonM
I'm surprised how many people don't like syntax highlighting. I appreciate it
because it helps me eliminate a small class of errors while coding, which is
misspelling keywords and improperly delimiting expressions. In Python, for
example, there are 4 different ways to delimit strings, so having syntax
highlighting indicates quickly to me when I accidentally ended a multi-line
string with a """ instead of what I began it with: '''.

I also find myself doing weird things sometimes when I get tired, like instead
of saying "class Foo", I'll type "def class Foo". Seeing the keyword "class"
stand out in the second instance is a quick clue that I'm doing something
stupid.

There are also cases where I've unthinkingly wanted to name a variable the
same as a keyword. Without syntax highlighting, I would have received a
strange error at compile time complaining about invalid syntax, but instead, I
see right away what I've done and avoid the problem altogether.

In the end, it's not a matter of whether or not I know my code or know the
language inside and out. It's simply a matter of quickly and effectively
fixing a large majority of small gaffs in my thinking and inadvertent
mistakes. Call it a crutch all you want, but you could just as easily say that
if you're not coding in hex, you're using a compiler as a crutch. What's wrong
with making your job easier?

------
jgrahamc
I made the following comment over at reddit on this story; thought it might be
of interest here:

As part of building the test suite for the POPFile project I built my code
code coverage module that produced colored files (one per source file)
indicating which lines had been exercised by the test suite and which had not.

Each line is colored green if the test suite executed it, red if not. Lines
are numbered.

An example of this can be found here:
<http://popfile.sourceforge.net/Module.html>

The code that does this is part of the POPFile project under the GPL.

John.

------
tlrobinson
Why am I not surprised that a Perl programmer feels that he's too good for
syntax highlighting?

That said, I do like some of his alternative highlighting ideas. Maybe someone
can hack together something with svn/cvs, etc.

------
andreyf
All of his suggested additions can fit in a column on the left hand side of
the code, since they only apply to lines, not words.

------
edw519
Tell you why I don't like syntax highlighting (or any crutch er,a helper).
Ever since I read the chapter about Woz in Founders at Work. The thing that he
thought made him so successful designing the Apple II: he knew every single
little part of it intimately, like the back of his hand. That struck me like a
lightning bolt. So that's how I feel about my code now.

If I want to do something, I read and reread and reread it over and over and
over until I practically memorize it. THEN it's part of MY firmware, and
that's when I really get insightful and productive. IDE's, syntax
highlighting, etc. are just crutches that keep my real "hacking muscles" from
developing. I won't use them. Black and green; that's all I know.

Similarly: I used to know every phone number I ever needed by heart until
speed dial came out. One day last year, I had the very frightening experience
of not being able to call a regular number from someone else's phone. I have
never used speed dial since. Anything that impedes my "brain exercise" is
something I do without.

~~~
asdflkj
Is indentation also a crutch that keeps your hacking muscles from developing?
As far as I can tell, arguments for and against both are exactly the same. If
you like one and not the other, it's a sign that these are matters of personal
preference more than anything else.

~~~
pfedor
That's a very nice point and thanks for making it, but based on the empirical
evidence I think that you're wrong. There are many very good programmers who
don't use syntax highlighting. But I don't know anyone who is not using
indentation. So there has to be an important difference between the two.

