Here’s a common question I see all the time when scouring my favourite forums: “how can I learn to program?”
20 to 30-odd years ago the answer was “go to school” or “buy a textbook + software and try it out”. The development ecosystem has obviously changed then. Developing software has permeated across various industries and the practice as a whole has become very easy to get into. Almost everybody has access to a computer with the Internet. Almost everybody can download piles upon piles of free software to use to get started and numerous guides. With web and mobile applications being exceedingly popular, the tools to get started right at your fingertips, and the news of lucrative salaries and an ever-increasing shortage of quality developers, the idea of becoming a self-taught developer is very tantalizing. The only real investment required now is your time.
With that being said, there are many resources out there that range from less-than-deal to just plain bad. Software development bootcamps are terrible. Sites like Codecademy and W3Schools, while helpful for learning syntax, don’t really teach you how to program. Instructor-led courses ultimately leave you at the mercy of the course syllabus and the quality of the instructor.
Perhaps one of the most important things you can do for yourself is to nail down your fundamental programming skills before you focus on building software.
Here’s my list of fundamental skills a “novice” developer needs before (s)he can start building things:
- First Language Syntax
- Variables and Functions
- Flow Control
- Data Structures/Algorithms
- (Optional) Object Oriented Programming
With these basic tenants down a programmer can theoretically build anything from scratch. Assume you were developing in a world with NO frameworks, NO libraries, NO protocols, and NO markup languages or stylesheets. This is everything you would need to get off the ground. As they say, “to create an apple pie from scratch, you must first invent the universe”. Once you’ve got these fundamentals down, you can go invent the universe… if you want.
Where you go and what you learn next depends largely on the avenue you venture into. If you’re a freelance web developer building small websites/applications for your clients, you’re going to be entrenched in the client side and spend a lot of time working with service APIs. If you’re an enterprise web or application developer you’re likely dealing with large databases and large amounts of data. As you mature you’re going to start learning some less trivial tenants:
- Design Patterns
- Asynchronous programming
- Software Architecture and Design
The list goes on and on and on. To elevate yourself to an intermediate and senior developer, you’re going to have to nail these down too. For now though, let’s get back on track.
The next question that always comes up is “what language should I learn first?”. The language you learn isn’t as important as the concepts you learn. With that being said, there are several good “learner” language options out there, many of which are driven by a particular language’s popularity. It does make sense — if you want to be an *x* developer, learn the fundamentals in *x* and you’ll be productive much faster because you won’t have to learn another language.
Every starter language is going to have its pros and its cons. I still like C as a good first-timer language to learn at least your first seven tenants because it teaches you a bit about the nitty-gritty underlying concepts that will help you later on. If your first language is something like Java or Python you would never know that strings are tricky. You might learn that strings are immutable but never really understand the significance of that. You might learn that a variable stores data in memory but you won’t get hands-on experience using pointers/references and working with memory addresses, nor would you understand the significance of the fact that Java passes references to objects by value. You might know that there’s a garbage collector running to free memory, but you won’t understand the beauty (and difficulty) of it until you’ve had to use malloc() yourself.
C does have two problems. It’s not object-oriented so you’ll never learn those concepts, and it’s rather uncommon to have a C application that connects to a database for persistence. When you reach this stage in the game, I would move on from C. Python is a great utility language to learn. It does a lot of things very well and it’s used across a wide range of programming applications. Java is a pretty solid language to learn as well thanks to sheer popularity, very good libraries, and near-strict enforcement of OO. You can, of course, use those languages from the start and skip C altogether, as any thumbs-up I give to C as a learner language is just a result of my own experience.
Once that’s all said and done, you can pat yourself on the back. Chances are you’ve experienced first hand the joys of getting your first “Hello <name from input>” program running and the sheer frustration of a segfault (had you gone the C route) or at least the trouble of hitting a large bug. You know how to control the flow of your application, how to delegate repeatable pieces of code to functions, how to iterate across loops, how to recursively solve problems, how to read/write data from a variety of sources (incl. flat files, databases, console), and how to structure code in a logical manner. You have a taste of what development is all about and you have the skills to build everything. NOW you can go ahead and pick the stream you want to pursue, be it web, mobile, server side, client side, embedded, game development, or any other stream of programming, and start learning how to build real software of whatever type you choose!