What are some of the best ways to learn programming?

Author – Jeff Warner, Software Development Manager at CenterStone Technologies, Inc.

There is nothing magical about learning to code but I would suggest a few guidelines:

1) Less is more
2) Practice
3) Keep learning

Less is More

Start small. Ruby, Python, C, Javascript are all great. Skip the frameworks (Rails, Django etc.) for now. Skip HTML, CSS, Apache, IIS, AWS etc. You want to learn how to program so learn how to write a program. There are lots of intro books and websites for those languages, start there. If you add in frameworks, databases, markup languages and virtual environments, your head is going to explode. You don’t learn by drinking from a firehose, you just get soaked (but you might not be thirsty anymore).


Since you are learning a programming language like Ruby, write lots of small programs. Seriously, write 10-15 programs with 10 or more lines of code. Each one should do something very straightforward, ideally a single sentence should describe what it does: reverse the output of any input, add up a series of numbers, print out the lines of a file etc. Work up to something like a command line calculator or search a web site for keyboards etc. The typical getting started books have lots of these types of programs for you to work on.

The most important part is you HAVE to write these programs. You cannot learn to program by only reading about it.
The goal is to be able to start with a blank editor screen and write a program that does something meaningful (think a subset of “cat”, “grep”, “curl” or whatever) without having to use the browser to copy and paste an answer from someone else. Checking the syntax on a command is okay (does the file go in the second or third parameter) but not how to write a loop or check a condition.

Keep Learning
So you can create your subset of a tool like “grep,” now what? Well guess what? You have learned how to program. You were successful because you focused on learning one thing.
Now is a time to add in something else. Let’s go with learn HTML (skip Javascript, CSS and the various frameworks). Learn the HTML tags, build a few static pages and look at them in the browser. Nothing fancy but it is HTML. Now modify your grep tool to output HTML instead of of text. Get comfortable with this by building a couple of programs to output HTML, again, nothing fancy, the value is doing it repeatedly and being successful rather than inventing the next Facebook.
So you are “comfortable” with a programming language, HTML and generating HTML output? Well, if you are comfortable with structured data from spreadsheets or a tool like Access, you can start with a framework like Rails, otherwise, you need an introduction to structure data and databases. A getting started guide to MySQL, Postgres or Redis (maybe) would be a good place to go).

Once you are at the framework level, you can start to focus on “real” problems. This approach works regardless of web, app or desktop development, the only difference is the tools and frameworks. Break it down and learn the basics before trying to go to the next level. It is really hard to do bike stunts if you can’t even ride a bike.

Expect to spend lots of time in the Keep Learning phase. That part never stops.