Archive for June 27, 2013

Even for Experts! What Makes Code Hard to Understand?

When I visited Indiana earlier this year, I got a chance to meet with Rob Goldstone who told me about these fascinating results that Michael Hansen describes in the blog post linked below — that adding two blank lines to a Python program (which has no change to execution) significantly changes how programmers understand the code.  Are his participants getting confused, because spacing matters horizontally in Python but not vertically?

The other experiments that Michael describes below, like the one I’m quoting below, are also amazing.  Michael isn’t dealing with students — most of his participants are programmers with 2-10 years worth of experience, and graduate degrees.  How could they get this code so wrong, when the problem is the kind of thing we might give on a CS1 exam?  Here’s one hypothesis: We really don’t know just how hard programming is, and both students and programmers understand it far less well than we expect.

Why did 50% of our participants get this program wrong? There is a strong expectation amongst programmers that you don’t include code that won’t be used. Elliot Soloway identified this and other maxims (or rules of discourse) in 1984. Like conversational norms, these unwritten rules can have a powerful influence on interpretation.

via What Makes Code Hard to Understand? | synesthesiam.

June 27, 2013 at 1:31 am 7 comments


Enter your email address to follow this blog and receive notifications of new posts by email.

Join 9,005 other followers

Feeds

Recent Posts

Blog Stats

  • 1,879,121 hits
June 2013
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930

CS Teaching Tips