How to start programming
14 Mar 2016How to start programming:
- Have a small problem you want to solve
- Don’t worry about the language, tools, or “doing it right”
- Read and do exercises until you think you can solve the problem
- Try to solve the problem
- If you didn’t solve the problem, repeat steps 3 and 4
- If you did solve the problem, find a new problem and start over at step 1!
Learning anything is about finding some pleasure in the activity, and then finding a way to continue practicing that activity often. Programming can be an extremely fun activity, akin to playing a board game or working on a puzzle. At first, however, programming can be very confusing, like when you don’t understand the rules to a game. If you didn’t want to win the game or believe that the game might be fun, you’d think it’s dumb to move around all these pieces on the board. Having a programming problem you want to solve gives you a motivation. Also, whenever you learn something, you can think of how you might apply that nugget of information to your solution.
The repetitive aspect is just a way to push and grow after achieving one goal.
Picking a problem
Try to choose something small but slightly ambitious. Here are some ideas to get you started:
- A program that tells you what the weather will be, and recommends what to wear (e.g. umbrella, coat, rain boots, etc.)
- A “choose your own adventure” website
- A two player tic-tac-toe game, with text input and output (advanced: make a computer player!)
- A “matching game” (you know, where you try to flip over two of the same cards)
- A website which displays a different message to anyone who shows up.
- A program which renames all the files in a folder to start with dates.
- A program that finds your name (or any text!) in a file and prints out that line.
- A program that randomly draws images or patterns.
Find a problem that speaks to you.
- If you are frustrated finding files in your computer, pick something that can help with that.
- If you like games, make a game.
- If you like art, try to make something beautiful with your computer.
Don’t worry about the programming language
Unfortunately, I see people following this pattern:
- Obsess over what programming language to use
- Never start
Everyone likes to talk about language differences… non-programmers are curious, programmers like to argue. But when you’re starting out, as soon as you know when language, it will be easy to learn anything else. Sure, there are merits and concerns with any language to start with, but the are miniscule compared to the effort of simply going through an online resource, reading a book, going to codecademy, etc. If you’re having a tough time choosing a language, then… randomly choose from {python, javascript, ruby}. Still unsure? Go to Tiobe and choose something from the top ten. But do it. Do it before you leave this page!
Final thoughts
Programming is fun and useful. Some people say programming is the “new literacy”. I disagree, although I still think everyone should learn some coding. But I’ll save my thoughts on that for another day and another post.
Sidenote: I’ve decided I’d like to start blogging more. I’m realistically not going to write a tutorial to using a new programming tool every day, and I have a lot of thoughts about other topics, so you’ll (hopefully) see a smattering of posts about CS education, Ph.D. life, and possibly privacy in addition to technical stuff over the coming weeks.