What Programming Really is?


Given the general nature of that question, and the fact that programming is seen as a hideously complex subject, you’re probably expecting a highly convoluted and technical answer. But you’re not going to get one (sorry about that). In truth, it’s quite easy to say what programming is, so I will:

Programming is breaking a task down into small steps.

That’s just about the most honest and accurate answer I can give. It also has the added benefit of being concise, and sounding very much like something you’d read in an official book on the topic, thus adding to my credibility.

You’re perhaps wondering what exactly I mean by breaking a task down into small steps, so I’ll explain the point in more detail. Let me start by giving you a fact about programmers that you’ll find very easy to believe:

Programmers think in an unnatural way.

This refers just to the fact that programming is breaking a task into small steps, and that’s not the usual way that your mind works. An example will help you to understand what I mean. Here’s a task for you to do:

Put these words in alphabetical order: apple, zebra, abacus

I’m going to assume that you managed to put them in alphabetical order, and ended up with abacus, then apple, then zebra. If you didn’t manage that, reading this article may soon become one of the worst experiences of your life so far.

Now think about exactly how you performed that task; what steps you took to put the words in alphabetical order, and what you required to know in order to do so. The most obvious thing you needed to know was the alphabet; the desired order of the letters. Then, if you’re like me, you probably did something like this:

  1. Look through the words for one beginning with “A”.
  2. If you found a word beginning with “A”, put that word at the beginning of the list (in your mind).
  3. Look for another word beginning with “A”.
  4. If there’s another word beginning with “A”, compare its second letter with the second letter of our first “A” word.
  5. If the second letters are different, put the two words in alphabetical order by their second letter. If the second letters are the same, proceed to the third letter, and so on.
  6. Repeat this whole process for “B” and each other letter in alphabetical order, until all the words have been moved to the appropriate place.

Your method may differ slightly, but probably not by much. The thing to notice (which I noticed particularly, since I’m having to type all this) is how much time it took to explain a process which happens without any real conscious thought.

When you saw that you had to put some words in alphabetical order, you certainly didn’t first sit down and draw up a plan of what you were going to do, detailing all the steps I listed above. Your mind doesn’t need to; you learned to do it once when you were a child, and now it just happens. You have a kind of built-in shortcut to that sequence of steps.

Now let’s try another simple example:

Count the number of words in this sentence: “Programming really can be fun.”

Hopefully you decided that there were five words. But how did you come to that decision? First you had to decide what a word is, naturally. Let’s assume for the moment that a word is a sequence of letters which is separated from other words by a space. Using that rule, you do indeed get five words when looking at the sentence above.

But what about this sentence:

“Sir Cecil Hetherington-Smythe would make an excellent treasurer,minister.”

Notice my deliberate mistake: I didn’t leave a space after the comma. You might also feel it’s a mistake to name anyone Cecil Hetherington-Smythe, but that’s a debate for another time. Using our rule about sequences of letters which are separated from other sequences by spaces, you would decide that there were eight words in the new sentence.

However, I think we can agree that there are in fact ten words, so our rule clearly isn’t working. Perhaps if we revised our rule to say that words can be separated by spaces, commas or dashes, instead of just spaces. Using that new rule, you’d indeed find ten words.

Now let’s try another sentence:

“Some people just love to type really
short lines, instead of using the full
width of the page.”

Although it might not be obvious, there is no space after “really”, nor is there a space after “full”. Instead, I took a new line by pressing the return key. So, using our newest rule, how many words would you find in that last sentence? I’ll tell you: you’d get sixteen, when in fact there are eighteen.

This means that we need to revise our rule yet again, to include returns as valid word-separators. And so on, until another sentence trips up our rule, and we need to revise it yet again. You might wonder why we’re doing this at all, because after all, we all know what we mean when we say “count the number of words”.

You can do it properly without thinking about any rules or valid word-separators or any such thing. So can I. So can just about anyone. What this example has shown us is that we take for granted something which is actually a pretty sophisticated “program” in our minds.

n fact, our own built-in word counting “program” is so sophisticated that you’d probably have a lot of trouble describing all the actual little rules it uses. So why bother?

The answer comes in the form of an exceptionally important truth which you must learn. It’s to do with computers (even your own computer that you’re using to read this). Here it is:

Computers are very, very stupid.

To some people, that statement is almost sacrilegious. You can understand that, because computers are really expensive. If you’ve just bought a Ferrari, you probably don’t want your neighbour to come along and say that it’s ugly and slow. If you’re a Mac user, you might actually kill a person who said your computer was stupid.

Nevertheless, it’s true – computers are desperately stupid. Your computer will sit there and do whatever mindless task you tell it to, for days, weeks, months or years on end, without any complaints or any slacking-off. That’s not the typical behaviour of something that’s even slightly clever. It will also happily erase it’s own hard disk (which is a bit like you deleting all your memories then pulling parts of your brain out), so we’re clearly not dealing with an intimidatingly intelligent item.

In fact, computers are so painfully stupid that they require to be told, in minute detail, how to do even the most laughably simple of tasks. It’s quite pathetic, when you think about it (or perhaps we’re pathetic, since we’re willing to pay ridiculous amounts of money to own them). In fact, just about the only positive thing about computers is that they’re completely obedient.

No matter how crazed your instructions might be, your computer will carry them out precisely. By now, hopefully you can see how this is all tying together. Programmers tell computers what to do. Computers require these instructions to be precise and complete in every way.

Humans aren’t usually good at giving precise and complete instructions since we have this incredible brain which lets us give vague commands and still get the correct answer. Thus, programmers have to learn to think in an unnatural way: they have to learn to take a description of a task (like “count the number of words in a sentence”), and break it down into the fundamental steps which a computer needs to know in order to perform that task.

And that is all there is to the question.. What Programming Actually Is?? 🙂

About Ali Turab Gilani
BS Computer Sciences from G.C University Lahore. Served as Teaching Assistant for Programming Fundamentals... Vice President IEEE Society Student Chapter...

Leave a comment