February 28, 2005


Natural languages are easier to understand and read than they are to speak and write. Programming languages are easier to write than they are to read. Why is this?

My own rather unsatisfying answer is that programming languages have much simpler grammars and smaller vocabularies, making them easier to write, and that there must be some sort of trade-off that natural languages are taking advantage of that makes them easier to understand. The large vocabulary in particular might be hard to learn, but lead to easier comprehension because listeners can figure out some unknown vocabulary from context.

I can think of dozens of arguments against my guess, so feel free to post your own hypotheses. If you want to argue that the original question assumes too much, just consider this: why is it more attractive to write code from scratch than to maintain existing code?

How can we make programming languages easier to read?


At March 01, 2005, Blogger Fraxas said...

I think that it is fallacious to say that code is easier to write than English. Or at the very least, that you could more concisely express that idea as "code is easier to be precise in".

...Which kinda proves your point, come to think of it. John Carmack, of iD, once said that coding is the art of specifying a problem so completely that even a computer can solve it. Code has to be precise or it's not syntactically correct; because the execution environment for NL -- the context one speaker shares with another -- is so much broader, there's less need to be precise for there to be meaning.

There's a thread there -- Computers don't know how to extract any meaning at all -- or very little -- out of lines that aren't syntactically and semantically correct, whereas english rules let sentences my garbled be a little and youall still parse can them.

At March 01, 2005, Blogger JeremyHussell said...

If you look carefully, I don't think I actually said that code is easier than English, just that English is easier to read than write, and code the opposite. There may be an implied comparison in there somewhere, but I didn't intend it that way.

...Which kinda proves your point, come to think of it, albeit by showing that English is vague enough to be misinterpretable not only by the reader, but by the writer as well.

Expanded the rest of this comment into an actual post...


Post a Comment

<< Home