I think it’s probably important to establish up-front, that the question of whether to teach everybody to code has been done to death. This guide assumes that you have considered these arguments, and are comfortable with your decision to give programming a try. Personally, I tend to fall into the ‘teach-everyone’ camp.
UPDATE: Okay kids, go to college. Don’t follow my example. You don’t have to study computer science to be a programmer, but you do need some kind of bachelor’s degree to be taken seriously. Things are starting to change, but for right now, college is essentially a requirement. This does not mean that you must study computer science to be a programmer. It certainly helps, but I know plenty of programmers with degrees in subjects other than Mathematics and Engineering.
Picking your first language
There is something special about your first language. Like a first love, it stays with you long after the infatuation period is over, past the breakup, and will continue to influence your decision-making for years to come.
I would suggest something in the dynamically typed space, because imposing a bunch of arbitrary rules seems pointless when you’re just starting out. C/C++ is too low-level, Java is too clunky, and lisps are too (con(fus(ing()))).
Joking aside, don’t agonize too hard over the decision, they’re mostly all the same once you get into them. There are some differences in syntax and the particular ideology behind the language, but for the most part they are all the same.
Whatever you do though, as a first language, please don’t pick PHP, VB, or SQL. These are so alien to all the others that they will forever warp your ability to grasp concepts which do not conform to the particularly strange way they are embodied in these languages. SQL is a great second language, but because it is super abstract, (so much so that it is considered declarative), and designed to deal with relational databases, that it’s really not a great language to start with. PHP is shit. Seriously don’t learn it.
Now go out learn it!
The task of learning to code is actually quite difficult, not because of a lack of available information as has traditionally been the case, but actually because there is now a metric fuck-ton of it, so your task is to sort through the crappy resources to find the pearls.
First things first, figure out your preferred learning style. If you find that you are more experimental, this is going to drastically change how you should approach the problem of learning to code.
My first experience with programming was out of a book: “Teach yourself BASIC” or some other similarly awful step-by-step learn something complicated through repetition with very little explanation style books that permeate the genre. I hated it, but for many people this was the way they learned. I suppose it was magical to be able to print things to the screen, but at 12 I didn’t really have the wisdom to appreciate that. Had I not revisited programming later in life, I would probably be doing something detestable like practicing law. Had I actually enjoyed BASIC, as Dijkstra would say, I would have been forever scarred, and my ability to program irreparably damaged. So, I guess it all worked out.
If you enjoy a guided tour of a programming language from start to finish, I would suggest the Learn ____ The Hard Way series by Zed Shaw. I have not personally read any of them, but I think he’s a great writer, and seems to genuinely care about his students’ ability to read and understand the lessons. Plus he’s sassy, and I like that.
College is Dead?
So, I have a funny story:
A few years ago, I volunteered at a career day for my little brother and sister. Elementary age kids. You’ve maybe done this yourself. It’s a casual way to introduce young impressionable minds to the careers that they may one day pursue. This is not really something that you’re expected to prepare for, or really take too seriously. I took it way too seriously. Some parents showed up in their uniforms, talked about what they do day to day. I prepared a PyGame demo and had the kids talk out the algorithm for binary search. I didn’t see those other parents’ presentations, but I’m pretty sure I crushed it. A kid asked for my autograph.
At some point during the first presentation, the teacher asks, “So, what should they study in college if they want to be programmers?”
Now, what I mean to say is: “It’s never been easier to get into coding, and if you want to try programming, why wait until college? Start when you get home if you want!”, what comes out is: “You don’t need to go to college!” The teacher is, of course, mortified by my statement and immediately goes on damage control. The message was more polished for the next class. I think college is really great if you want to broaden yourself as a human being, get some independence from your parents, and be surrounded by smart people who are into the same things you are.
If college is your thing, go for it. Go to college.
There was a lot of enthusiasm a few years ago around the concept of MOOC style offerings from major universities actually replacing the traditional college experience, but in general I think that for most people an in-classroom lecture style works pretty well. It’s certainly not the case that the ever-popular formula “anything + internet = instant_success” is always going to hold true. If you’re interested, try the free offerings from things like MIT Open Courseware before paid credential factories like Coursera.
Choose your own adventure Style
This is my favorite. Unlike advanced Mathematics, you can actually learn quite a few programming concepts without constantly being forced to understand the foundational underpinnings of the thing you’re actually trying to learn. This might seem trivial, but it’s extremely powerful. Not being forced to know about Boolean Algebra in order to understand that that “if (x > 10) do_stuff(x)” that you’re only going to do stuff when the value of x is greater than 10. Is x stored in a register, or allocated on the heap? Is do_stuff virtual? What’s the calling convention for that function? What are literally all of those things I just said? Don’t panic! You don’t have to know right now. This is due to a property that we programmers absolutely adore: abstraction. Suspend disbelief for a moment, learn the concept you are currently working on, and make a mental note to understand the wizardry that makes it possible.
This runs counter to the traditional educational paradigm where complex concepts build on top of simpler ones. Instead, most programming concepts tend toward elegance and simplicity. It’s true that to be a very good programmer you should strive to understand everything you possibly can, but the notion that you have to start from first-principles is incorrect, and potentially hazardous to your educational goals. As long as you’re curious, you can approach the task in any way you want.
Breadth-first: learn a little about a lot.
Here is a summary of a Bachelors degree in Computer Science.
- Learn a language.
- Learn some complicated mathematics of questionable value.
- Now learn another language, similar to the first.
- Now learn a third language.
I’ve probably glossed over some stuff about algorithms and data-structures, but that’s pretty much it. You get some solid exposure to a lot of things, but you probably won’t come away from the experience feeling necessarily ready to tackle any programming challenge life throws at you.
Depth-First: learn a lot about a few things.
This is definitely my preferred choice, because it’s incredibly easy to look like an absolute wizard compared to the first camp.
Oh, that’s cool, you know the first few chapters-worth of C/C++/Java like everyone else? Well I’m a D-lang black belt mothafucka, get on my level!
^^ This could be you. You’ll be writing 200 line code-haikus that outshine the competition because you actually know how to take advantage of the language. You’ll look like a rock star compared to someone who just knows the bare minimum required to pass. Learn the internals of the language, get into the culture that produced it, and dive as deep as you can into the most advanced topics you feel capable, and you won’t regret it. There isn’t really a degree plan to follow, but it has other benefits if you’re willing to invest the time.
No matter how you choose to approach programming, the most important thing is to never stop learning. Technology is in a constant state of change, and when you decide to pursue this as a career, the requirement of life-long learning comes with it.
Good luck, and please shoot me a comment if you found this rambling mess helpful in any way!