Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming

Modeling How Programmers Read Code 115

An anonymous reader writes "Following up on an experiment from December, Michael Hansen has recorded video of programmers of varying skill levels as the read and evaluate short programs written in Python. An eye tracker checks 300 times per second to show what they look at as they mentally digest the script. You can see some interesting differences between experts and beginners: 'First, Eric's eye movements are precise and directed from the beginning. He quickly finds the first print statement and jumps back to comprehend the between function. The novice, on the other hand, spends time skimming the whole program first before tackling the first print. This is in line with expectations, of course, but it's cool to see it come out in the data. Another thing that stands out is the pronounced effect of learning in both videos. As Eric pointed out, it appears that he "compiled" the between function in his head, since his second encounter with it doesn't require a lengthy stop back at the definition. The novice received an inline version of the same program, where the functions were not present. Nevertheless, we can see a sharp transition in reading style around 1:30 when the pattern has been recognized.'"

This discussion has been archived. No new comments can be posted.

Modeling How Programmers Read Code

Comments Filter:
  • by phizi0n ( 1237812 ) on Saturday July 06, 2013 @11:27PM (#44207093)

    This article is complete garbage. They tested 2 people with different code that produces the same results and then make up a narrative of how novice and expert coders think in different ways. Use the same code to test a much larger pool of programers and then the results might actually be interesting.

  • Bad link (Score:5, Informative)

    by Anonymous Coward on Sunday July 07, 2013 @12:05AM (#44207225)

    They should link to the follow up post that talks about the experiment with 162 programmers http://synesthesiam.com/posts/what-makes-code-hard-to-understand.html. It also links to the paper that has even more information.

  • Re:300 Hz (Score:5, Informative)

    by ThreeKelvin ( 2024342 ) on Sunday July 07, 2013 @06:12AM (#44208157)

    Human eyes "flicker" when they look at something. They will remain stationary for a time, then move quickly to another position. (See Saccade [wikipedia.org].)

    The time for one of the fast movements between positions is in the order of 20 ms when reading, giving us a frequency of about 25 Hz. (It's only half a sine wave, so the period is 40 ms.)

    Using the Nyquist-Shannon sampling theorem [wikipedia.org], we get that we must sample the eye movement with a frequency of at least 50 Hz, otherwise we'll get aliasing. Now, bring in the engineering rules of thumb, which say that it's no good riding on the Nyquist limit, but you'll need to oversample the signal a bit in order to get a useable result (It of course all depends on what you'll be using the signal for. In feedback control you usually oversample by a factor of 8-20, and in signal processing in the neighbourhood of 2-8) and you end up with a samping frequency of 100 - 400 Hz.

    So, in summary, 300 Hz sounds like a perfectly good sampling frequency, perhaps even a bit in the low end, depending on what you'll use the sampled signal for.

  • by Anonymous Coward on Sunday July 07, 2013 @06:39AM (#44208261)

    Your stick man needs to see a chiropractor STAT!

"Gravitation cannot be held responsible for people falling in love." -- Albert Einstein

Working...