Writing for computers, writing for people

Of late, I’ve been taking a computer class on C, and doing a little side-study of Go and C++. Most people know about the importance of writing your code so that the computer can understand it. But it’s also important to write your code in a way that your fellow humans can understand it. By the comments you insert and the way you format your code, you can either create a nightmare of gibberish that does only the last thing it was doing when you compile it or a structure on which others can build or from which they can take pieces to create new things. Just as literature has allusions and quotes at the chapter heads, a coder often makes use of others’ ideas in new ways. But for that to happen, the code has to be written in such a way that you can see what’s going on it.

This is also something that crops up in our use of ordinary language. When we “transcribe” a speech, we don’t usually capture all the “umms” and “ers”. And if it’s a transcription of a speech or something else being put out for public consumption, only the cruel scribe will leave in all the “likes” and “y’knows” or punctuate unfinished sentences to suggest that the speaker lost his train of thought and had to start over, as opposed to elucidating or rephrasing for clarity. In short, the system we use for talking to each other also needs polishing up for someone else to understand it.

In learning a language, one of the toughest elements is getting the hang of the way people actually use the language, as opposed to the way they claim to use it. And one of the toughest things for someone who learns the spoken language is to get the hang of what you do and don’t write down and what you need to rephrase. So whether you’re learning a human language or a computer language, always be on the alert not just for the rules, but also for the conventions that help people know that they’re on the same page.

About G Barto

This entry was posted in Uncategorized. Bookmark the permalink.

1 Response to Writing for computers, writing for people

  1. Niall Beag says:

    Quite. As I’ve said before, I recently picked up Python, which is supposed to be easy to write in a self-documenting manner. But as soon as you do anything with objects, it starts to get difficult. All I wanted was a tree as a list of lists, but in order to put in methods to act on the tree, I had to wrap it in an object and now my code’s a big ball of unnecessary dots and brackets….

    On the human side of things, people confuse “informal language” with “slang”, and refuse to teach it because “it varies so much from place to place”. True of slang, not of informal language.

    Example: elided sentences in English:
    [do you] want to come?
    [are] you ready?

    Because it’s so rarely taught, learners are often left to figure it out for themselves (aka “acquire” it). And sometimes they get it wrong.

    A Polish friend of mine once asked:
    “anyone wants to buy a bike?”
    He conjugated the verb “want” because it was the first verb in the sentence. Except that’s not what a native does. This isn’t a different structure from “does anyone want to buy a bike?”, but a reduced form of the same structure, with the first verb dropped.

Leave a Reply to Niall Beag Cancel reply


WordPress.com Logo


Google photo


Twitter picture


Facebook photo


Connecting to %s
