# Programming Language? What's That?

For those that are new to programming, I want to briefly explain what a programming language is.

Computers are fast computation machines but they are limited and inflexible. The only language they truly understand well is composed of numbers, a language with limited vocabulary. When we talk, we can shorten words, we can leave out words, we can compress multiple words into a single word. And yet, whoever we're talking to will understand us. We're capable of adapting and filling-in the missing bits from context and implication. By a computer's standards, human languages have massive vocabularies and grammars of incredible complexity. A computer is extremely literal--every step of an operation must be stated in exact detail with nothing left out.

A programming language is a compromise--a language that still must be exact--but it has a greater vocabulary so that a human programmer (that's you!) can express their ideas in a language that a computer program can automatically translate into the computer's language of numbers.

A programming language is a language designed by us to make it easier to instruct a computer what we want it to do.

Even so, the language is still exacting. Sometimes we have to explain what we want the computer to do in excruciating detail. A popular example is the construction of a peanut butter and jelly1 sandwich. If someone was going to prepare some food for me2 it's easy to get a peanut butter and jelly sandwich--I just ask for one.

But what if, for instance, your four-year-old niece wants to make you some food? You know that asking for "lemon meringue pie" is out of her league, but maybe a PBJ is doable. But she's never made one before. So you explain: "Get two slices of bread out. On the first slice, spread some of the jelly on it. On the other slice, spread some peanut butter on it. Slap the slice with the peanut butter on top of the jelly slice. Put it on a saucer and bring it on over for me to try!"

That is what programming is like--except one thing. You have to explain in even more detail. You have to take "Get two slices of bread out" and break it down into its tiniest steps: "Go to the bread box. Remove the bread loaf from the bread box". Wait. That's not detailed enough. We actually need to break "Go to the bread box" down, lets try "Stand up. Walk 17 steps south, walk 8 steps northeast...". That's programming. As programmers we take large tasks, and we carve them up into small tasks, then carve those up into small steps, then divide the steps into very discrete and tiny steps--and then use the programming language's vocabulary to explain the tiniest steps to the computer.

Fortunately, our human crafted programming languages make an effort to make it easier. When we discover that we are doing the same set of tiny steps over and over again in our programs, we extend the language's vocabulary to include a word that does all of those steps for us. Thus, it is frequently much easier than I made it sound when i was talking about PBJs. Let's go find out just how easy it is...as soon as I go make myself a PBJ.

• 1. Jelly is mandatory. If you don't have the jelly to smooth it out, its just a bunch sticky and clumpy stuff that doesn't chew or swallow well.
• 2. Perhaps I'm at mom's house! Or a restaurant...

## Post new comment

• Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h3> <h4> <h5> <h6> <blockquote> <iframe>
• Lines and paragraphs break automatically.
• Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.
• Use [# ...] to insert automatically numbered footnotes. Textile variant.
• Web page addresses and e-mail addresses turn into links automatically. (Better URL filter.)
• You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <glow>, <muf>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].
• Images can be added to this post.