What are some of the best ways to learn programming?
Author – , 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
3) Keep learning
Less is More
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.
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.
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.