News for hackers. Stuff that matters.
Re:How do we read code? by dchichkov on Wednesday December 19, 2012 @02:31AM (#4941581)
I think it is very important to use code from real-life applications, rather then synthetic examples like that, or like ones presented in the original article.

Otherwise the results of that research would be biased towards comprehension of meaningless chunks of code, rather that of a real thing.

Re:How do we read code? by scott_s on Wednesday December 19, 2012 @09:46AM (#4942756)
That's step 2. Step 1 is using contrived examples with clear differences in structure. You need to start small like this because in order to answer the basic questions, you need to eliminate experimental variables. That way, you can establish basic principles for how people tend to build up an understanding of code.

Then you can move on to what we're really interested in: how do people build an understanding of complex applications with many interacting parts? But you can't go there first; if you do, you won't be able to interpret your results because there will be just as many fundamental questions as experimental variables.

Re:How do we read code? by Chris_Newton on Wednesday December 19, 2012 @02:47AM (#4941608)
I agree, but isn’t this the curse of most experimental research in programming techniques?

Ideally, we’d compare like-against-like using industrial scale applications, implemented by professional practitioners, controlling for everything except what we’re trying to investigate. Finding opportunities to do that in practice is rather harder, because obviously most real software development projects don’t get implemented twice by identical teams making exactly one significant change in their approach.

What I thought was interesting here was that even though it is only a toy program, there were still some patterns to how the reader explored it that might suggest more general trends. As long as we understand the limitations of the experiment and don’t overgeneralise any conclusions, isn’t some data still better than random conjecture?

Re:How do we read code? by dchichkov on Wednesday December 19, 2012 @03:45AM (#4941705)
Yes, but why can't some regular code (from an open sourced project) be used in the experiments? I'm sure there should be a way to do that.

It is just, that this synthetic code is broken. It doesn't read. There is no flow in it. It just looks from the first glance, like a non-interesting, unimportant piece, that doesn't do anything, so there is no point in reading it.

Does that sound convincing enough, that there is a big difference between reading synthetic examples and actual code?

Re:How do we read code? by jejones3141 on Wednesday December 19, 2012 @06:43AM (#4942156)
Yes, it does. There was a study of how well people could remember positions of chess pieces on a board. The general public did equally badly for both random arrangements and those that could actually appear in a game, but skilled chess players did well remembering arrangements that could appear in a game, but were no better than the general public on random configurations.
Re:How do we read code? by _delirium on Wednesday December 19, 2012 @12:07PM (#4943490)
> isn’t this the curse of most experimental research in programming techniques?

Of most experimental research with humans in general, for that matter. It's a big topic of controversy in psychology, because a lot of quantitative psych results are from synthetic tasks in lab settings, which leads to argument over the extent to which those are accurate proxies for real-world behavior.

Re:How do we read code? by saraid216 on Wednesday December 19, 2012 @03:22AM (#4941674)
This actually smells like the same kind of problem you'd have in studying classrooms...
Re:How do we read code? by Chris_Newton on Wednesday December 19, 2012 @05:04AM (#4941921)
I’m not sure if this is what you were alluding to there, but I think there is a real problem with experimental research in this kind of field that often the test subjects are students, who tend to have much less skill and experience than working programmers with a few years of practice behind them.

It’s a specific instance of a more general problem: it seems clear that programmers often work differently depending on their familiarity both with programming generally and with the specific domain they’re working in, but we’ve only scratched the surface in identifying exactly how they work differently, and therefore what practical steps we might take to make things better for programmers in different situations.

Re:How do we read code? by infinite8s on Wednesday December 19, 2012 @11:33AM (#4943322)
This is often the problem with a lot of psychology research, where the only easily available subjects are university students who receive credit for participating in the research (or a nominal payment).
Re:How do we read code? by synesthesiam on Wednesday December 19, 2012 @10:48PM (#4946198)
For some kinds of experiments, Mechanical Turk is helping to alleviate the problem: http://pps.sagepub.com/content/6/1/3.short
Re:How do we read code? by eholk on Wednesday December 19, 2012 @02:49AM (#4941612)
For an experiment like this it's important to have small, self contained code fragments. It wouldn't be fair to expect someone to decipher the whole Linux kernel source in a short amount of time, for example. Given a sufficiently small chunk of code, almost everything looks synthetic. I imagine many real life application have sections that take two arrays, find the numbers within a certain range and then take the intersection like this program does.
Re:How do we read code? by dchichkov on Wednesday December 19, 2012 @04:02AM (#4941735)
Actually linux kernel is very readable. And there is nothing synthetic about it. Just try opening some random page of linux kernel source code, and you'll see. Say: http://www.linux.fm/source/crypto/xor.c/

Hey, you can even listen to it ;)