advertisement
advertisement
  • 01.03.12

Why Aren’t Computer Programming Languages Designed Better?

An experiment by computer science researchers shows that Perl, a major commercial programming language, is no more intuitive to use than a fake language with a completely random syntax. What gives?

Why Aren’t Computer Programming Languages Designed Better?

For many digital products, poor user interface design and UX can sink an app’s fortunes even if the underlying engineering is powerful and innovative. (Remember Color?) But what about the interfaces behind the interface, the ones that developers spend hundreds or thousands of hours interacting with while they build software for the rest of us?

advertisement

Yes, I’m talking about programming languages. Unless you’ve had specialized training, looking at lines of code is like reading hieroglyphs, only less intuitive. According to findings by researchers from Southern Illinois University, this reaction isn’t just because you’re a n00b: they found that Perl, a major programming language used by untold zillions of developers, is no more intuitive to novices than a language with a randomly generated syntax.

Let that sink in. Programming languages are tools, designed by people for a specific purpose. What this study showed is that the design of this particular tool, Perl, is so ridiculously opaque that, from the perspective of a novice programmer, a string of characters bashed out by a monkey at a keyboard would literally make an equal amount of sense. Ouch. Of course, the researchers didn’t set out to take down Perl. They were running experiments to determine the usability of Quorum, a so-called “evidence-based programming language” whose design was informed by surveys, usability studies, and field tests. “We have observed that novices learning to program at the university or younger levels can have significant difficulty learning the syntax of general purpose programming languages, which may initially seem arbitrary,” the authors write.

They created a “placebo language” called Randomo, whose syntax was randomly generated, to use in trials alongside Quorum and Perl. Novice programmers were able to write sample programs more accurately in Quorum versus Perl–an interesting, but not terribly surprising, result. More surprising was how Perl compared to Randomo. To quote the paper: “Perl users were unable to write programs more accurately than those using a language designed by chance.”

I asked Andreas Stefik, the paper’s lead author, what design attributes an “evidence-based programming language” like Quorum had that made it easier for novices to use accurately. He said that their usability testing showed that simply finding natural-language replacements for some of the more abstruse syntax went a long way. For example:

integer i = 0
repeat 10 times
i = i + 1
end

That still looks mostly like Greek to me, but Stefik compares it to this equivalent statement in Java (“which is similar to Perl is some ways,” he says):

for(int i = 0; i < 10; i++) {
}

That’s not Greek, it’s Klingon. The Perl version uses fewer characters, which many geeks would no doubt see as more efficient or precise; but Stefik says that the Quorum version accomplishes exactly the same commands. “I think that whenever you make a product design simpler there’s a potential danger of removing features that experts need,” he tells Co.Design. “We are trying very hard not to do that.”

advertisement

So why aren’t all programming languages designed this way? “I doubt that most language designers meant for their languages to be hard to understand or use,” Stefik says. “The problem is that programming languages are created either by committee or by extreme technical wizards with magical math powers. The broad computer science academic community has not paid a tremendous amount of attention to programming language usability. I think that our discipline mostly uses anecdotes to argue about programming languages. As such, it is no wonder that the arguments get heated.”

Startups like Codecademy, which aim to teach non-coders how to program, are white hot. Would they be necessary if the programming languages themselves were better-designed? Probably–Python may be considered “easier” to use than Perl, but it still takes some hand-holding to get started with. But evidence-based programming languages are a fascinating variation on the traditional practice of UI design. Every piece of software we use was written by other people, slaving away over thousands of lines of code. Why shouldn’t those “interfaces” be as humanely designed as the ones we tap and swipe?

About the author

John Pavlus is a writer and filmmaker focusing on science, tech, and design topics. His writing has appeared in Wired, New York, Scientific American, Technology Review, BBC Future, and other outlets.

More

Video