News for hackers. Stuff that matters.
Re:How do we read code? by drothlis on Wednesday December 19, 2012 @08:13AM (#4942394)
> I think it would be interesting to compare the results with a similar eye track of a program written with more emphasis on data flow

It would also be interesting to compare with code with decent syntax highlighting. For some reason I don't quite understand, most syntax highlighting out there highlights the wrong thing: keywords. It needs to highlight the site-of-definition of functions, variables, etc. For example: http://david.rothlis.net/code_presentation/distracting_synta...

Re:How do we read code? by synesthesiam on Wednesday December 19, 2012 @12:29PM (#4943618)
This is something I'm definitely interested in. I don't have any syntax highlighting in the current experiment to avoid controversy over the "right" way to highlight, and to put the focus on content of the code. For the future, though, this would be an excellent experimental manipulation to try. Thanks!
Re:How do we read code? by eholk on Wednesday December 19, 2012 @11:29AM (#4943294)
Some of the initial analysis Mike has done shows that programmers spend the majority of their time looking at identifiers. I think this supports your point.
Re:How do we read code? by kibwen on Wednesday December 19, 2012 @08:52AM (#4942531)
It's pretty easy to understand why keywords are highlighted, even if it isn't justifiable. 1) Programmers are lazy, 2) regexes are the quickest way to implement basic syntax highlighting, and 3) if your keywords are reserved words (as most are), then you can get infallible highlighting with the expression /(^|\s):listofreservedwords:(/s|$)/.
Re:How do we read code? by drothlis on Wednesday December 19, 2012 @09:12AM (#4942623)
Emacs, at least, already provides primitive parsing / heuristics that work reasonably well for most languages. See the example in the link I posted above: All I had to do was customise the colour and font-weight of various things already recognised by Emacs: function-name, variable-name, type, etc.

Maybe what I don't understand is all the effort people put into making pretty themes for their editors --there are millions of these themes out there-- and almost all of them insist on highlighting (drawing attention to) the language's keywords of all things. The least important part of any program.