Understanding Misunderstandings in Source Code [pdf]
ssl.engineering.nyu.edu
ssl.engineering.nyu.edu
Me too, but not so much with subjects that have just a couple of months experience with the language.
I'd prefer to identify things that still confuse programmers with, say, five years.
Things that confuse noobs contain a lot of noise. If we craft a coding convention based on that, we might end up with:
i = 1;
total = 0;
while (i <= 100) {
total = total + a[i - 1];
i = i + 1;
}
because the noobs were confused by zero-based arrays; increment operators like i++; and the jumpy, out-of-order evaluation of for(;;) syntax. Since the average professional software engineer has more experience than our average subject,
the effect sizes reported may be overstated for some populationsWatching some functional programmers use immutable variables to show their intent of what they are doing was very helpful. Example : Whippedcream = whip(cream); Vs Cream = whip(Cream);
I'd agree that someone who is not used ternary operators might be confused with this, as I have been before, but I find it to be much cleaner now that I've been using it. It's also a little harder to debug.