Learning Programming: IntroductionPosted: September 10, 2008
More people should know how to program*. More resources are available than ever to help one learn. Pc’s are ubiquitous, and the open source movement and the internet make powerful languages of every flavour (C, Python, Haskell, R…) and difficulty easily available, along with extensive documentation. It should be a cakewalk, right? So why aren’t there more programmers?
I didn’t give the matter much thought until the last year, when I’ve had a few people (all smart, vibrant women with strong physical science backgrounds) ask me to teach them, and I realized I didn’t know where to begin. I realized that learning to program is fundamentally different than, and orthogonal to, learning programming languages. Too often, programming books are glorified syntax specs. Not much seems to drain enthusiasm to learn than trying to memorize facts (like a syntax) without context! There are exceptions, like How To Think Like a Computer Scientist, but even these don’t spend enough time on how to debug code, grok the wholeness of code from its parts, and other zen skills that good coders have. Not that *I’m* a good coder by any means, but I’m certainly a lot better than I was five years ago!
To be fair to Downey, et al., it’s not the job of every book / site to start from a Programming 101 perspective, but it would be nice to have some that do (recommendations welcome!). I’ve been finding that programming is extremely mysterious, even to otherwise smart, cabable, scientific people, until they’ve done some. “What exactly is a program?” is the kind of question I hear, that I don’t usually have a good response to.
Luckily, humans (me included) are quite adaptable, and there are other good models for learning programming: learning to speak and read, learning music, learning to drive. All of those share some common traits: learning the abstract skill and a technology simultaneously, understanding the general goal while learning the parts, and self-reinforcing cumulative skill-building.
Sometimes, I look back on my own history, and I wonder exactly how I learned to program. Oh, not syntax… that’s easy to find online, or in books, but on the wider skills of algorithms, best practices, version control, program flow, and all the other skills mentioned in Sijin Joseph’s Programmer Competency Matrix. For me, learning these skills has been a lurching, iterative process, especially since I didn’t have that matrix to guide me. I had to discover what skills I needed, convince myself that they were worth learning, then find resources and examples, and finally actually learn them. Usually I decide learning some skill is worthwhile only when I need to solve a problem that requires the power that skill unlocks.
It’s been inefficient, and if there’s something the rationalist mind of a programmer hates, it’s inefficiency.
In the articles to come in this series, I hope to help to create resources to help novice programmers (and lets face it, we’re all novices in some area) get over that first hurdle of getting their first programs working, and understanding where to go next. I also hope to demystify the programming process, and show that all programmers have histories that start with incompetence and see it recur at regular intervals.
* Because it’s a phat gig, well-paid. Because programming democratizes power. Because it’s sexy. Because it’s fun. Because if I say so, it must be so, since I’m always right. Because I’d have more people to talk to about it….