Lately I’ve been thinking a lot about beginners and the very understandable struggle to grasp programming that many of them face. This post is mostly aimed at those who currently find themselves in this position.
When it comes to creating, there is no substitute for hands-on experience and the same rings true for programming as well.
If you can spend three months reading a 1,000 page reference book on a given programming language, you’ll almost certainly walk away with some theoretical knowledge. Useful, but not very practical on its own. You’ll get the big picture, no doubt, but you won’t be productive or have much confidence in your newfound knowledge until you actually start writing code.
To me this is akin to reading a large DYI book cover to cover. I won’t be an expert on mending a fence, turning a table leg on lathe, or putting up storm drains simply because I know how such things are done in theory. It’s possible, nay, likely that when the first problem arises, I won’t know how to handle it, save for employing common sense. I’ll have to figure things out, try, make mistakes, and (hopefully) ultimately fix them. It is in this struggle that real skill is developed, honed, and ultimately mastered.
For that reason, I’m a huge fan of seeing beginners get their hands dirty. To this day even, when I’m learning a new programming language or framework, I like to solve practical problems as a way to quickly get acquainted with the ins and outs of said language.
Being passionate about mathematics, my go-to place when I’m learning a new programming language is Project Euler. [1]
I like the approach that it presents for for several reasons:
- The self-contained problems go from extremely obvious to fairly hard. The progression is gradual.
- In the process of solving problems, you will, out of necessity, end up learning about numbers, string manipulation, files, conditionals, functions, classes, etc. All of the basics that you should master in order to get started on real projects will be exercised to some degree.
- The emphasis is on getting the result, but many problems will not be solvable with naive algorithms, particularly when using scripting languages like Ruby and Python. This is an opportunity to learn more about algorithms (if you are a beginner) or more about optimizing code in a given language (if you are learning that language, but are otherwise an experienced programmer).
- You can look at other people’s solutions, which are often posted in a forum that’s accessible to those who have solved the problem themselves. You’ll learn about algorithms, more elegant ways to accomplish the same result, and even discover new languages you haven’t heard of before.
- There is an element of gamification. It’s fun to see yourself go up in the leaderboard as you solve more problems.
The only downside is that it’s quite math heavy and that can scare away some beginners. If this doesn’t put you off tough, I highly recommend giving it a shot. [2] Be forewarned though, it can be rather addictive. 🙂
UPDATE: Follow up post about alternative programming challenges sites.
Get more stuff like this
Subscribe to my mailing list to receive similar updates about programming.
Thank you for subscribing. Please check your email to confirm your subscription.
Something went wrong.
Number one in my book is having a side project idea for which the new language is an obvious tool — the one you’d been meaning to do but the languages you had to hand would make it hard work and the new one should ease the pain points.
Lacking a full project, then having a collection of code katas of whatever form; Project Euler is just one obvious source if you’ve not accumulated several. Those can be small projects from years gone by, just re-done to exercise the new language (e.g. a window where you drag and drop files and get their hashes).
Definitely, Steve.
my take on pe polyglotism is at http://www.fourtheye.org/projecteulertable.html
there is also
http://rosettacode.org/wiki/Rosetta_Code