New Scientist - USA (2013-06-08)

(Antfer) #1
38 | NewScientist | 8 June 2013

these enormously tall towers reaching down
to ancient technology.”
And being stuck with so many pidgin
versions of the early programming languages
is a big headache.
The first problem is that they are hard to
write – “inhumanly hard,” as Edwards puts
it. They are largely composed of patches and
layers that provide cheap, quick fixes to bugs
or jerry-rigged functionality. As the languages
have grown more complicated, the programs
have grown longer. The on-board systems of a
Boeing 787 Dreamliner chew through about
6.5 million lines of code; in a 2010 Mercedes S
Class, that number jumps to 20 million. Even a
program as comparatively simple as Microsoft
Word is estimated to run several million lines.
And that’s where the real trouble sets in.
Most programs are full of tiny grammatical
mistakes – unintended indentations, a stray
bracket, a comma in the wrong place and
so on. According to a widely cited estimate
there are 15 to 50 errors per 1000 lines of
delivered code. These minuscule errors can
render entire programs useless.
Did you introduce one? You won’t know for

sure until you allow the computer to compile
and run the code. But the compiler can’t tell
you if your code works until after you have
written the entire program.
Manual debugging would be a fool’s errand.
Just counting all 20 million lines of code in
that Mercedes would take you the better part
of a year – and that’s if you forgo meals, sleep
and bathroom breaks.
“This stuff is so complicated that we’re
constantly making mistakes – often disastrous
mistakes,” Edwards says. “We go back and
fix them but the results are often very
unsatisfactory.”
Unsatisfactory barely covers it – the
consequences can be fatal: a 2010 investigation
by The New York Times uncovered software
and programming errors caused death and
serious injury in a slew of radiation therapy
programmes.
Programming errors have wrecked
multimillion-dollar transnational projects –
remember the 1996 test launch of the
European Space Agency’s Ariane 5 rocket?
A bug in the control software, written in the
language Ada, caused the rocket to self-
destruct 37 seconds after blast-off. In 2010,
a computer glitch cost investment firm Knight
Capital half a billion dollars in half an hour.
Thankfully, most of us won’t experience
such catastrophes, but the simple truth is that,
as more of our lives become digitised, software

Brendan Mc

der

Mid/

reuters

” This stuff is so complicated
that we’re constantly

making mistakes – often
disastrous mistakes”

more intuitive, helping more people program
and do so with fewer mistakes. According to
the original launch report, Fortran would
“virtually eliminate coding and debugging”
by replacing the opaque 0 s and 1 s with simple
text commands such as “READ”, “WRITE”
and “GO TO”. A “compiler” specific to each
machine would take care of the translation,
converting the programmer’s textual
statements into something a computer could
understand. This allowed the programmers
to think in their own language rather than
tailoring their thoughts to a particular set
of microchips.

Language explosion
Nearly 60 years later, there has been a kind
of Cambrian explosion in languages – to the
detriment of comprehension. READ and
WRITE have evolved into ever less intuitive
and more opaque commands reflecting more
complex logic. Move from 0 s and 1 s to words,
and people quickly become dissatisfied with
the limitations those words place on their
ability to express themselves. Mark Pagel, who
studies linguistic evolution at the University
of Reading, UK, says humans – and the way
they translate their thoughts into instructions
for computers – are so varied that no one
language is sufficient.
As a consequence, there are probably
3000 or 4000 high-level languages around
today, says Alex Payne, a former Twitter
engineer and curator of the annual Emerging
Languages Conference, and many of them
work in tandem. Facebook alone uses C++, Java,
PHP, Perl, Python and Erlang among others.
The expansion shows no signs of slowing.
A year ago, for example, Google released its
Dart language as a replacement for JavaScript.
According to a leaked 2010 Google email,
“Javascript has fundamental flaws that cannot
be fixed merely by evolving the language”.
And yet, the variety is misleading.
Despite the linguistic divergence, from a
functional point of view most languages
are still just thinly veiled versions of Fortran.
“There’s not a big difference from where
programming was in the 1960s,” Lopes says.
Bret Victor, who used to design interfaces
for Apple and now works freelance, agrees.
“Python, Ruby, Javascript, Java, C++ – they’re
all the same language,” he says. “They’re
different dialects of fundamentally the same
way of speaking.”
Jonathan Edwards at the Massachusetts
Institute of Technology goes further. “We
never actually throw anything away, we
never raze to the ground, we simply build a
new storey on top of it,” he says. “We have

130608_F_Program_Languages.indd 38 30/5/13 14:14:43

Free download pdf