Programming Is a Sport
Computers are dumb. But you probably already knew that. The implication of this, however, is that programming is often very frustrating.This is most evident when you’re just starting out.
A little background: I’m two years into my bachelor’s in computer science, and by far, the question I get asked most has to do with programming, particularly how difficult it is to grasp. These interactions usually end with me smiling and offering a standard “I know!”. That was, until a while ago, when I realized something. Maybe it was the way they were going about learning it, because programming is actually like a sport.
If I asked you to explain the basics of your favorite sport, I bet you could do it in under an hour. More importantly, you could also explain it well enough so that I could understand the game, and theoretically play it too. Unless your favorite sport is cricket. No one understands cricket.
Anyway, let’s say I happen to stumble upon this favorite sport of yours and I decide to give it a shot. What happens? We all know it. I turn out to be a huge flop.
That’s how people tend to learn programming.
They get all the rules straight, follow a couple of tutorials (you can try pluralsight, by the way), then expect to be able to write a program just like that. But like playing a sport for the first time, they end up being a huge flop.
Yes, you do have to know the rules first, but that’s just the beginning. The more important part is actually trying to program something, which is the equivalent to actually kicking the ball for the first time, making a first shot, or whatever you do in American football.
Likewise, your initial attempts at programming will probably suck, so you’ll refer a lot to the book, tutorial, or whatever you’re using to learn. And that’s fine. Not everybody’s first shot ends up being a goal.
Your first shot will likely end up going in an entirely different direction, but we all have to start somewhere—everyone has to go through a first try.
So after you’ve learned the rules, give it a shot. I guarantee whatever method you’re using to learn has some examples to follow. As a first attempt, you can try and replicate the example without referring to the source. This will force you to think about what you’re doing, and help you get free from dependence on the instructor or source. Otherwise, you’ll get a false impression that you actually know what to do, when in fact you don’t, and the moment the source is removed, all your knowledge will be gone.
Now you’ve made your first shot, what next? Well, you know it. Practice.
In relation to our sport, you’ve got to keep shooting, passing, running, and all that. You have to spend time on the field improving your techniques and skills. You can’t progress in any sport without consistently practicing, or training; however, you also can’t solely rely on the act of practicing itself to make you move forward.
Why? Because you don’t get better by mindlessly shooting the ball or throwing the ball into the air. You get better by practicing different scenarios, like scoring a goal by aiming it at the bottom-right corner, practicing a dive to home base, or running before making a shot. You improve on aspects of your gameplay so you can beat various circumstances you may encounter in the sport.
It’s the same with programming—you get better by practicing scenarios. You build a program that keeps finding an average of numbers you input. You don’t mindlessly practice how to do, say, a for loop, which is a piece of code that allows the program to do something a specific number of times. No, you practice using the for loop to do something, like build a program that can run six times whenever a user inputs the number six, or a program that keeps finding an average of numbers you input. By making sure your program actually tackles certain problems you can and will encounter, you’ll progress.
Once you’ve got all of that covered, the final step is to try and build a piece of software that does something. It’s time to get into the game.
No pressure; you can always ride on beginner’s luck. But it’s time to use all your newfound skills in a real-life situation, where you’re not in control and everything is changing. Get a feel of the game.
You can just play using the various scenarios you’ve practiced and, of course, try to win. You can also switch it up a bit. People learned their sport by straight-up playing actual games until they got better. You can learn programming by trying to build a program you’ve thought of, like a payroll software for your business. But once again, initially, you’ll probably suck at it.
There’s going to be problems too—you aren’t going to win every game, and you’ll have to keep learning and adapting to various circumstances. There will also be frustrating moments—shots missed, injuries, slip-ups—but eventually, you’ll get better at it.
Perhaps you’ll build the next Windows, or the next Facebook, or even that app you’ve always dreamed of—the possibilities are endless. So go out there and take programming head on, maybe with a poster of your favorite sportsman in view for motivation. Unless your favorite sport is in fact cricket, in which case, well, good luck to you.