How Experienced And Novice Programmers See Code 238
Esther Schindler writes "We always talk about how programmers improve their skill by reading others' code. But the newbies aren't going to be as good at even doing that, when they start. There's some cool research underway, using eye tracking to compare how an experienced programmer looks at code compared to a novice. Seems to be early days, but worth a nod and a smile."
Reader Necroman points out that if the above link is unreachable, try this one. The videos are also available on YouTube: Expert, Novice.
Alternate blog post (Score:5, Informative)
The guy who was tested in the video has a blog post up (and his server actually works): http://blog.theincredibleholk.org/blog/2012/12/18/how-do-we-read-code/ [theincredibleholk.org]
Direct youtube links to the videos:
Video 1 [youtube.com]
Video 2 (Novice) [youtube.com]
Skipping (Score:5, Informative)
I don't know if this correct or PC, but when I first started I read code like a book. Every single word, left to right, down to the next line.
Now I skip.
I look where arguments go in, where they come out, where functions are called.
If I go into a code block, I look where the result is first and back track as needed
I look at the connections and only go deeper when I need to.
If I have to read legacy procedural code, I do what I do when I read the web. I ignore sub levels of information until I finish a level. On a web page I read the content, ignore the side bars and I don't click on links until I am done with that page. In procedural code I read top down and ignore nested blocks until I see what is going on the first level.
Re:Contacting Server... (Score:3, Informative)
My network admins were obviously not prepared for Slashdot.
Re:Code? (Score:5, Informative)
Polish notation is the one where it looks like Yoda speaking. Hungarian is where it looks like R2D2 dictated it.
Re:Comments (Score:4, Informative)
People who preach self-documenting code can't write good comments. They frequently don't write great code either.
Code tells me what it does. It tells me jack-fuck-shit about why it does it that way.