2012 was supposed to be code year. Remember that? We were all supposed to learn to code en masse, become our own technical cofounders, and build a better digital future.
Yet despite the fact that over 450,000 people, including Mayor Bloomberg, vowed to learn to code, we've so far seen a notable lack of success stories.
I was successful.
What follows is a step-by-step guide on how I went from almost a complete beginner to working as a professional software developer in just over a year, as well as my general thoughts on the process.
Background:In late 2011 I shut down my YC startup due to a lack of scalability, among other reasons. I made a list of what went right, what went wrong, and most importantly what weak points I would need to address if I ever wanted to make another serious go at a startup. Not knowing how to code wasn't the only weakness I had in my skill stack, but it was certainly a big liability for a web entrepreneur, and one of the most straightforward (if not easiest) areas to address. So when I saw the whole year-of-code thing start to take off I knew I had to do this, if only out of fear that everyone else would learn to code and I'd be left behind. At the time I was also having difficulty finding potential technical co-founders for a new startup idea, and I was told that this would become much easier if I were a developer myself.
Going into this I already knew HTML and CSS. I had also already taken AP CS in high school, and CS101 in college. I did well in both. But despite this I basically wasn't able to code my way out of a paper bag.
Why?
Firstly, C++ and Java aren't commonly used in (successful) web startups. But more importantly, being able to develop modern web applications, even the most basic of prototypes, requires mastery of almost a dozen different pieces of technology. So even though the backend language is probably the most important piece in the toolkit, it's also completely useless on its own. Over the years I had tried to teach myself modern web technologies many times before, dabbling in several different languages, but each time completely and utterly failing. Because of this I hope this retrospective will be especially valuable. I'll do my best to keep it clear and concise, but also to explain exactly:
- What I learned
- Why I learned it
- Why I learned it when I did
- How I learned it
Notice that 'how I learned it' comes last. This is because if you're not sold on why you should learn something, or if try learning it in the wrong order (before you're ready, or before it's needed), then you're probably not going to be successful.
The good news is that learning to code is now vastly easier than it was even five years ago. Back in the day the process was pretty much buy a book, make it through a couple chapters with no major issues, and then get stuck on some critical concept you don't understand — more often than not just because the book itself was poorly written. From there you usually went into IRC or visited a couple of web forums, promptly got told to go fuck yourself, then realized you couldn't go any further and so that was pretty much the end of that.
It's no longer like that.
Thanks to a combination of free online classes, well-written documentation, YouTube, Stack Overflow, various online communities, etc., learning to code at even a fairly high level no longer requires an off-the-charts IQ or parents who were engineers. Learning to code is now accessible to pretty much everyone who knows how to Google and has a little persistence.
I've tried to provide rough estimates of how long learning each of these technologies should take based on my experience, but of course it's going to vary considerably based on how much time you have in any given week. How long this will take also depends on whether you're mind mapping each of these technologies as you go, a process I'd highly recommend.
Learn HTML & CSS (2 - 3 weeks)Of all the technologies listed below, HTML and CSS were the only ones I already knew going into code year. That said, I still wanted to learn what HTML5 and CSS3 were all about. To do this I used the book The Definitive Guide to HTML5, which was pretty good for someone who already had some background in these technologies. I wouldn't recommend it for someone new to them though because there were tons of typos and other editing errors, so I think it would be more confusing than helpful. (Here is my Amazon review with more details.)
For beginners, the book that seems to be getting the most buzz on Amazon right now is HTML and CSS: Design and Build Websites. Even if you know nothing about HTML & CSS or coding in general currently, don't be discouraged; even though the book is several hundred pages, these technologies are incredibly intuitive and easy to learn, so you'll probably be able to get through it in less than a week.
Choose a languageBecause my initial goal was to know enough to at least be able to create at least a working prototype for my next web startup, the first step for me was to choose a backend language.
For most beginners this is a choice between Python and Ruby. I went with Python.
Why?
Ruby is probably the best platform to learn if you're a designer and you want to learn how to code to add value for your clients. But as an entrepreneur, I didn't know what I wanted to do next. You can use Python to make websites. But you can also use it to do scientific computing, machine learning, NLP, email processing, datamining, big data, etc. So if you have an idea for a minimum viable product but you don't really know where you want to take it two or three years down the road, then to me Python really just seems like the most pragmatic option.
Python is fairly mediocre in a lot of ways, but it's the only langauge without any deal breakers. It's fast enough to power websites that scale to several billion pageviews per month, it's easily learnable, and it's ubiquitous enough that it's (comparatively) easy to hire people who are already proficient. It's also extremely well documented.
Because of these advantages, it seemed like by far the best language to start with. This is a decision I'd definitely still make today.
Choose a MOOCWhen learning Python as a beginner, by far the best place to start is Udacity. This is because you get introduced to not only the language itself, but also to the basic computer science concepts you need to use it properly. In addition, each lesson comes integrated with assignments to maximize learning at your current ability level, as well as and a community to support and guide you, both of which are essential to success.
The two classes I recommend are:
- CS101 (2 - 3 weeks)
- CS253 (4 - 5 weeks)
CS101 will teach you how to program using Python, and afterwards CS253 will teach you how to program for the web. Both were fantastic. The one thing I'd note is that with CS253 you won't necessarily be using the same web framework and database that you'd choose for your own startup, but don't let that dissuade you from taking the course; starting here is what will enable you to teach yourself more interesting technologies later.
These classes won't teach you every feature of Python. In fact, even for the features they do cover, they'll only cover a small percentage of the ways to actually use them. The advantage though compared to a book is that you'll cover a large number of features quickly and in enough detail that you can get at least some value out of them right away. This is essential to hitting 'escape velocity', the point at which you can teach yourself everything else you need to know on your own.
On that note, since it was actually Codecademy that came up with the Year of Code campaign, you might wonder why I'm recommending Udacity instead.
The main reason is the structure of the content. Unlike Udacity, whose courses generally alternate between five to ten minutes of lecture and 5+ minute long programming exercises, Codecademy courses (along with Treehouse & Codeschool, which are/were similar) tend to alternate between a minute or two of instruction and a minute or two of programming exercises. These tend to only teach the tools, not the concepts, and worse they do it in such a scattershot way that I find I don't really learn anything from them even when taking careful notes. They also lack the supportive community of Udacity, which again is essential. I know many people who have started these classes, but literally none who have actually learned to code using them. And after going through several of their units myself, I don't see how anyone could be successful with them. That being said, Codecademy and Treehouse do have lists of success stories, so apparently they do work for some.
On the other end of the spectrum are Coursera and EdX, which are structured as 45+ minutes of videos, followed by several hours of homework. While I do know several people who have taken these courses and enjoyed them, none of them have been beginners. I generally would recommend against them though, especially for beginners, because they replicate most of the pedagogical weaknesses of the traditional classroom, rather than taking advantage of the Internet as a medium to make learning easier.
Learn More Python (3 - 4 weeks)After learning a backend language, the next major step is to learn a web framework. But before you doing that, I actually paused for a months weeks to teach myself more Python, as well as some other things that Udacity didn't cover. In order to teach myself more Python, I spent most of my time reading (and mind mapping) the official documentation.
- The most important place to start is learning the Python syntax for creating Classes and Objects: http://docs.python.org/2/tutorial/classes.html. This is a fairly slow read, but it's important because many of the other Python features, as well as the various web frameworks, are implemented using these tools. Also, if you're not already familiar with the concepts behind Object Oriented Programming, I would start by first watching some YouTube videos on the subject before attempting to read the Python documentation.
- I also taught myself a bunch of other Python tools which aren't necessarily essential to learning a web framework, but which you'd need to know anyway to actually program effectively with one: the built-in functions, regular expressions, String methods, String substitution, Lists, Tuples, Dictionaries, and Sets. (Don't bother learning about Frozen Sets.) Again, you'll need to first read and understand the Python documentation on Classes and Objects to understand many of these other language features.
- Go through some of the posts for "Python Idioms" and familiarize yourself with these. E.g. A few things to remember while coding in Python, and its discussion on Hacker News.
- Skim over the docs on how to import and parse textfiles, a well as how Datetime objects work and how to convert dates from one format into another. If nothing else, these two concepts tend to come up frequently during job interviews.
- Skim over the top Python posts on Stack Overflow. These threads cover some of the more difficult to understand features of Python. Most of these you don't need to know now, but if you ever want to take the more advanced courses on Udacity then these are invaluable.
- You can see the most popular Hacker News stories on Python here: https://www.hnsearch.com/search#request/all&q=python&sortby=points+desc
The database is the core of all modern web applications. The past decade has seen the rise of several database systems that don't require one to know SQL, and theoretically these actually perform even better than SQL databases if you use them correctly. However, in practice most people still recommend that beginners start by learning SQL and using a SQL database.
Why?
First, SQL databases are ubiquitous, and if you ever want to work as a professional software developer then you're going to need to know SQL. But perhaps more importantly, SQL forces you to learn how to organize your data in a structured way, and to think rigorously about how your data will actually be used. While data is structured and used very differently in NoSQL environments, having a solid grounding in the fundamentals is still essential.
To teach myself SQL, I used the book Head First SQL, which I'd highly recommend. I chose this because I'd had a longstanding fear of SQL, and this was clearly going to be the most painfree option.
That being said I did actually have difficulty understanding some concepts starting in chapter 4 (on database design), so I actually switched to reading Zed Shaw's book Learn SQL The Hard Way. This is extremely well written and easy to understand. However, the book is actually only half written — as of this writing, it only goes up to chapter 15, which I didn't realize until I got there. That being said, I still got a ton out of this book, and once I had gone through it I was able to go back to the Head First book and easily finish it.
So what does Unix have to do with SQL?
Absolutely nothing, except for that Zed Shaw recommends starting with his (short) book on Unix basics, The Command Line Crash Course, before reading his other books. This is because in practice you're going to need to know at least some basic Unix to actually install and configure your web framework, database, and many other technologies, as well as to actually push a site into live production. You're going to have to learn some Unix eventually, and this book is really short and easy, so you might as well just learn this now before going any further. Don't worry, this is significantly less scary than it sounds. If you want to learn more Unix after going through this book there are a lot of good resources, though personally I'd recommend just starting with YouTube.
Choose a Web Framework (1 - 2 weeks)The answer is Django.
Why?
- It's by far the best documented, so if your web-framework knowledge is limited to what you learned in the CS253 class I recommended above, then the difficulty you'll have learning anything else will likely outweigh the benefits.
- It's scaleable to well over a billion page views per month.
- It's (comparatively) easy to hire folks who are already proficient in Django.
- It's possible to write code in a way that's modular. For example, you can write raw SQL queries (or use SQL Alchemy) instead of using the Django ORM, and you can use your own templating language instead of the built-in one. This means that if you ever want to switch to another web framework that's even more scaleable, it's relatively easy to do so because you're not tied to the framework unless you choose to be.
- If you ever want to learn a new Python web framework, or even learn a web framework in a completely different language, you're much more likely to be successful if you're already proficient in Django.
So how do you learn Django? By far the best way is to just go through the tutorial on their website. My recommendation is to do the tutorial verbatim, including the parts that cover features you don't think you'll ever use. In addition to getting exposed to new ideas, at a practical level it will make it much easier to actually follow the the tutorial if you're doing all the steps yourself. Once you finish the tutorial you should know enough to mostly understand the rest of the documentation, albeit with some help from Stack Overflow, blog tutorials, etc.
JavaScript and jQuery (4 - 6 weeks)The last major tool you need to learn to at least make your own prototypes is JavaScript. JavaScript is just a simple programming language that runs in the browser, and is necessary for creating anything more complex than just a static HTML page. To learn JavaScript I started by reading Douglas Crockford's book JavaScript: The Good Parts. I successfully made it through the book, but in retrospect I wish I had started with something a little easier. Many of the language features are explained using CS jargon relating to the ontology of programming language theory, as opposed to just explaining how to do basic stuff in plain English. While this is one of those books that everyone 100% needs to read, it might be better as a second book for most people. I don't have any specific recommendations for a first book, but there are plenty of highly rated options if you search on Amazon. The good news is that when you do get to the Crockford book it's actually fairly short, so it's not as much of a slog as it might otherwise be.
So what's the deal with jQuery?
Basically JavaScript has lots of flaws, both as a language and also in terms of how it interacts with web browsers; jQuery is a library that (for the most part) abstracts these flaws so that you don't need to think about them. There are other more modern javaScript libaries that are currently very trendy, like Angular, Ember, Backbone, etc. However jQuery is so ubiquitous that you really need to know it anyway, so you might as well learn it first. This is especially true since even with the modern modern js frameworks, certain tasks still often require using jQuery in addition. This means that it wouldn't really make sense to, say, learn Angular first even if you plan on mostly using it later. The book I used to teach mysolf jQuery was jQuery compressed. In addition to being one of the best computer books I've ever read, it's also less than $5 on Amazon, so I really can't think of any good reason to use anything else.
Miscellaneous tools (About 2 weeks)In addition to the technologies above, I also taught myself Jinja and Less.
Jinja is a templating language that I use instead of the one that comes built into with Django. Theoretically it's faster and has more features, but the main advantage is that if you ever want to switch away from Django then you don't need to rewrite your frontend code. Jinja has tons of features, but because it's generally considered poor practice to put logic in your frontend code, it's probably best to avoid anything much more complex than just iterating through variables.
Less extends CSS in a way that allows you to use variables, math operations, and a few other features. This allows you to write CSS that's cleaner and more maintainable. As is the case with Jinja, you probably don't want to use (or even learn) every feature. There is a similar tool, Sass, which which is generally considered somewhat better than Less because of its support for Compass. However, it requires some extra software to get it working with Python. There are tons of blog posts debating which is the better option, but in the end you can probably just pick one at random and be fine.
If you've gotten this far then you've probably already heard many people telling you how you should be using Virtualenv. If you're like me, you looked at the docs and then decided to put it off for as long as possible. However, I finally found this tutorial which makes it really easy. Learn it.
Git (About 2 weeks)Git is relatively easy to learn if you just want to learn it for your own projects. I taught myself mainly using the O'Reilly book Version Control with Git, but I wouldn't especially recommend it. The book spent way too much time on the internals of Git and other esoterica that's not useful for beginners, whereas not nearly enough time was spent on the fundamentals. Instead I'd recommend going with Pro Git, which seems to be much more highly recommended despite being somewhat older. You can also download the entire book for free at git-scm.com/book, which is good, because free.
In terms of learning how to use Git as part of a team, this is difficult to learn from books since each team uses their own process. Probably the best way though is to get a job as a developer and spend a couple months fucking up their repositories.
Data Structures and Algorithms (3 - 4 weeks)Learning these probably isn't necessary if you just want to learn the minimum to create your own prototypes, but you will need to know at least some of this stuff if you ever want to build production software or get a job as a developer. For learning both data structures and algorithms, I'd recommend Tim Roughgarden's YouTube Videos. These might not be as mathematically rigorous as going through formal proofs in a textbook, but unless you're designing high-speed trading software or something similar this is probably all you'll need to know and then some. These videos do a great job of taking a relatively boring and difficult subject and making it easy, interesting, and accessible.
Applying for jobs as a developerThe good news is that even with a skillset limited to what's described above, a level of proficiency easily achievable within a year, it's currently much easier to get a good job as a developer than it is for a recent law school graduate to get a good job as a lawyer. (C.f. Law School Transparency.)
The bad news is that even if you learn all of the stuff above, getting a good job as a developer still requires jumping through a bunch of hoops. Unless you spend a few extra months (or years) building up a portfolio of great code on GitHub, most companies you interview with will likely give you take home coding assignments that can take anywhere from the better part of a day to almost a week. These sorts of demands would clearly be unreasonable if you already had a great portfolio, but if you don't have that yet then this is not especially different from any other industry. (And at least you're not stuck with 200k or more worth of student loans.)
Here are a few links that may be helpful if you ever need to do a technical interview:
- Big-O Cheat Sheet - The key is being able to do this analysis yourself, not just memorizing the charts.
- Coding for Interviews - A great resource for getting good at common interview questions.
- Cracking the Coding Interview - Like an SAT prep book for technical interviews.
- Project Euler - Practice coding by solving complicated logic problems.
Learning to code won't solve all your problems. It won't make you harder working, better at networking, or improve your understanding of what makes a problem worth working on. Despite the hype, learning to code probably won't make you a billionaire.
Despite this, not knowing how to code is a significant limiting factor for many people, especially if you have startup aspirations. Before year of code, I'd still taken a handful of CS classes, so I knew the basics. And even now I'd probably still only describe myself as a beginner, and semi-technical. Being able to prototype my own startup ideas and work as a novice developer on an engineering team might not sound especially impressive in comparison with people who have been on the tech side their entire lives, but there's a world of difference between where I was then and where I am now. If instead of learning to code I had immediately jumped back into the startup world, I can now see multiple ways I would have fucked up, many of them likely fatally.
Fifteen years ago, when it was still very difficult, it probably was acceptable to say that learning to code wasn't a good use of your time. But now that you can literally learn the basics in six weeks, if you go to a VC or a potential co-founder and tell them that you want to spend the next twenty years in this industry, but that you're not willing to spend six weeks learning even the basics, then you're going to look like a complete and total moron. That might sound harsh, but I have a feeling there won't be many comments from VCs or technical folks who disagree.
So what's next?
My initial plan wasn't to work as a developer indefinitely, but rather to stay on the tech side for at least two years and treat it as my own personal TFA-style program. That way I'd have the options of either continuing to work as a developer, doing another startup, or going back onto the marketing side of things. I'm still not sure which direction I'll ultimately go, but learning to code will clearly be invaluable regardless. That's especially true since these days, even if you want to work in marketing, getting any job that's higher level than entering stuff into Excel all day for minimum wage pretty much requires knowing how to code at roughly the level described above.
In terms of improving as a developer, the next things on my to-learn list are Angular, Selenium, Karma, Bash scripting, High Performance JavaScript, and the UNIX and Linux System Administration Handbook. That should give you a decent idea of what my weaknesses are right now. But it should also give you a decent idea of what additional strengths I'll have six months from now, all built on top of the basic foundation described above.
Thanks for the post. I too have been struggling to learn all the technologies and just get overwhelmed at every single little thing you need to know, and all the guides just assume you know most of it. I too have gave up way to much and it's nice to hear your succeeded. I am gonna follow in your footsteps and try to make 2014 my year to learn to code. Planning on following your advice here because its the most down to earth advice I have read in a while that organizes stuff in a good manner.
Thanks for your time and best of luck with your programming future!
Posted by: Joseph Rosenblatt | November 06, 2013 at 03:50 PM
yey! cool to hear that im learning the right technologies. I decided to learn how to program at the middle of this year; I chose python over ruby and can't find someone who did the same, I chose it because I would like to explore data mining later on. I'm now learning jquery; at first I thought I needed to learn backbone and angular instead of jquery, but I had this feeling that I needed to learn it first. Good post. Best of luck :)
Posted by: Hellodianne | November 07, 2013 at 11:59 PM
I teach programming to absolute beginners.
Your post was spot-on and I forwarded it to friends who are trying to learn on their own.
It also contains the best explanation I've heard of why Python is the language for beginners to learn right now ("while mediocre in many ways, it's the only language that has no deal-breakers").
The only objection I have is to the idea of reading documentation to learn a subject. I find that learning without a clear practical objective ("I need to make a class for a monster in my game") is almost useless in comparison to learning /with/ a clear objective. I'd link a good introduction to the concept of a class instead of recommending to read the docs (if there isn't any, tell me, I think I can write one.)
Posted by: Aur Saraf | June 09, 2014 at 08:38 PM
Aur,
That makes sense. The reason why I just read the docs on OOP is because I was already familiar with the basics of it from having taking AP CS in high school (C++), and CS 101 (Java) in college. In general though, if not for the fact that I mind map everything I read, I would probably forget 90% of the material almost immediately unless I was building something at the same time. But because I'm doing the mind mapping, I find that I'm still able to retain a pretty good working knowledge of what I read even if I haven't used it yet in practice. Obviously when I do try stuff out for the first time there is always going to be some practical knowledge that just has to be learned through experience, so to some extent I am time shifting this part of the learning process until later, but overall I'm pretty happy with my rate of learning.
Alex
Posted by: Alex Krupp | June 09, 2014 at 10:25 PM