|Does Syntax Coloring Work?|
|Written by Ian Elliot|
|Monday, 14 December 2015|
Programmers divide into opposing camps: the hair-shirt-wearing one claims "I don't need no IDE" and at the other extreme the plea is "give me all the tools you can!" What you feel about syntax coloring probably depends on which group you gravitate to. Now we have some, long overdue, research that gives us some hard facts to argue about.
Syntax coloring, or highlighting, has been around quite a while. When you first see it you either get it or think it is for baby programmers. Perhaps one of the best known public pronouncements on highlighting is Douglas Crockford's talk where he says that "syntax highlighting is for kids"
It may be for kids, but those kids probably program better with it than without it.
A simple experiment proves that syntax highlighting is a good thing. Take two functions in Python and ask the subject to perform a modification to each, but one is syntax highlighted and the other isn't. Time how long it takes and use an eye tracker to see if there is any difference in the way the code is processed by the programmer.
The first finding was that the tasks on the syntax highlighted code were performed faster - the difference was 8.4 seconds (the result was significant at the 0.05 level).
In addition the programmers shifted their gaze less often on the highlighted code. That is, they performed fewer context switches. The difference was 23 context switches (the result was significant at the 0.05 level).
So is it for kids?
Interestingly there is evidence that Crockford might be right.
There was a small negative correlation between the time difference on the two tasks and how experienced the programmer claimed to be. So there is evidence that the more experienced you are the less effect syntax coloring has on your performance.
As an aside, the author of paper notes that experienced programmers tended to underestimate their competency and less experienced programmers were more realistic. This is suggested as evidence of the Dunning-Kruger effect - but this is where the under-skilled over rate their ability. In the programming case it seems the over-skilled under rate their ability, so it is more the inverse Dunning-Kruger effect. Perhaps this is evidence that the more you learn in programming the more you realize how ill equipped you are to cope with the true nature of the task.
The amazing thing is that this study hasn't been done before and what about all the variations on syntax highlighting - why not investigate what works. It seems that we are willing to look at studies on the design of the general UI but not our own specific UI, be it IDE or code editor.
The other small surprise is that the sample size was just 10 graduate students. Surely some software company could fund this sort of research and provide some strong evidence of what works?
or email your comment to: firstname.lastname@example.org
|Last Updated ( Monday, 14 December 2015 )|