Work In Progress

Semicolons and other trivialities (Technical)

Computer languages are very precise because they are designed to allow you to do anything. They differ, in this way, from natural languages, which are designed to communicate about things that your audience is familiar with. Natural languages are therefore flexible, because so much of what is being communicated is already known. (One can loosely define natural language as the means of producing in one creature certain mental states (often images) similar to certain mental states in you; thus we rely on most of the mental state already being there, and don't need to explain what a bird is every time we say that we saw one sitting on a telephone poll.)

Computer languages, by contrast, exist to create machines which can do anything (within a somewhat narrow realm of physical possibilities). As a result, they make no assumptions about what you're trying to say, because there are no assumptions possible. Anything you say might be what you mean. It's not that computers are stupid; it's that they're unprejudiced.

Anyhow, computer languages invariably use certain types of markers, just like we use punctuation. In many languages, semicolons denote the end of an instruction. If you omit one, typically this results in an unintelligible program, since (in general) any two instructions can be combined in several ways, and the compiler can't know whether you had meant to combine them or separate them.

Errors like leaving off semicolons or other small things (akin to punctuation) often plague beginning programmers; they go to compile their programs and get a stream of errors and search about bewildered; many of them cursing at the stupidity of the machine.

Having just compiled something where I accidentally left off the semicolons (I very rarely do that any more), it just occurred to me how different it is now. I'm so used to programming that semicolons are natural (this tends to come fairly quickly); compiler errors are just a different sort of thing to me now. They used to be a mystery to decipher. Now they're actually an aid to getting things right. I intuitively know how to say what I mean, and compiler errors aren't problems, they're more like the signposts on trails. I've come to see the program as a thing, not that the compiler creates, but that I create. I can almost see its pieces working together as if they were real.

It really is amazing what human beings can grow used to.

Posted by Chris on 07.28.2005.