167: Your Guide To Computer Programming. Part 2 of 4.

Take Up Code - A podcast by Take Up Code: build your own computer games, apps, and robotics with podcasts and live classes

Categories:

Why should you learn how to program? What is programming? What specific steps can you take? How can you apply programming? To be a good programmer, it doesn’t take a lot of math. Instead, you need to be able to break larger ideas and processes like how to play tic-tac-toe into small steps. Imagine you were trying to explain tic-tac-toe to a small child. Then take a step back and imagine that you’re watching yourself explain this to a small child. Where do you begin? Be alert for all the steps. You don’t just start putting X’s and O’s down on the paper. You first need to ask if the child wants to play. Then you can begin explaining the rules and eventually playing. There will usually be some parts you forgot about. What happens? The child will either ask or make a wrong move that you then have to explain. Maybe you forgot to mention that once you write a letter in a box, that it becomes unavailable for the other person to use. Seems obvious, right? Until the child draws an X on top of your O and claims victory. Even such a simple game is much easier to explain to a child than to a computer. That’s because the child can draw conclusions based on other games and life experiences and naturally understand things without being told. You don’t have that luxury with a computer. No matter how old a computer gets, it never develops any common sense at all. If you forgot to tell the computer about the same rule that you can’t make a move in a square that’s already occupied, then your game will likely crash. It’s a bug. The ability to program then, really comes down to how good you can be about planning for all the possible ways something can go wrong and writing instructions to either make sure they don’t happen in the first place or how to handle each situation if they do. The full episode explains more about programming and how you write the instructions that the computer will follow. Listen or read the full transcript below. Transcript The topic today is what is programming. Now, I already explained this in episode 2. I’ll try not to mention the same things and that early episode remains a good resource to help you understand programming. I’ve talked with a lot of people about programming. People working in retail stores, attending seminars, selling products door-to-door, and others who ask me how to program. There’s a widely held belief that programming is hard and beyond their ability or doesn’t apply so why should they bother. I’ve had people tell me that they could never program because they’re no good with math. Or they have goals to become a manager instead. Or they tried it once and didn’t get good grades. And some have said that they know how to program already and have built web pages. I’m going to talk about these things while describing what is programming. I hope that you’ll realize that it’s not as hard as you thought and that it really is necessary. Listen to the previous episode for more discussion about why you should learn how to program. First of all, you don’t need to know a lot of math in order to program. Unless, of course, you’re programming something that inherently uses math such as a library that calculates physics equations. That sort of thing just isn’t very common though. Even if you want to create a game that allows a player to launch annoyed avians through the air following a smooth arc, you might be surprised by just how little math you really need to know. Most of the time, all I really need to do is add or subtract things. Let’s say you want to simulate a ball thrown up in the air, slowing down gradually, and then falling back down again. It should speed up as it falls. Does this require trigonometry, calculus, or some physics formulas where you have to remember the gravitational constant? No. All it takes is to add a little bit of velocity each time you