What Is Programming?

When you teach someone how to make a sandwich, your job is made much easier because they already know what a sandwich is. It is this common, informal understanding of “sandwichness” that allows them to fill in the gaps in your explanation. Step 3 says to spread the peanut butter on one slice of bread. It doesn’t say to spread it on only one side of the bread or to use the knife to do the spreading (as opposed to, say, your forehead). You assume they just know these things.

Similarly, I think it will help to talk a bit about what programming is in order to give you a sort of informal understanding of it.

Programming is telling your computer how to do something. Large tasks must be broken up into smaller tasks, which must be broken up into still smaller tasks, down until you get to the most basic tasks that you don’t have to describe—the tasks your computer already knows how to do. (These are really basic things such as arithmetic or displaying some text on your screen.)

My biggest problem when I was learning to program was that I was trying to learn it backwards. I knew what I wanted the computer to do and tried working backward from that, breaking it down until I got to something the computer knew how to do. Bad idea. I didn’t really know what the computer could do, so I didn’t know what to break the problem down to. (Mind you, now that I do know, this is exactly how I program these days. But it just doesn’t work to start out this way.)

That’s why you’re going to learn it differently. You’ll learn first about those basic things your computer can do (a few of them) and then find some simple tasks that can be broken down into a few of these basic things. Your first program will be so easy that it won’t even take you a minute.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.97.47