This is how I would learn to code if I could start over. For context, I work at Microsoft, but before that, I did six internships across three countries. So, yeah, I've done a line or two in my life. Wait, not like that!
What the f-To tell you what I would change, I first need to tell you what I did. I started coding in grade 11. Well, sorta. We started with this language called Scratch. It's basic game development made for children. Nobody would be stupid enough to, let's say, do an entire Google coding interview in this language, and maybe even do shots every time the code fails.
So let's just skip that and get to the important stuff. I went to Waterloo and in order I learned first Racket, then C, C++, HTML, CSS, TCL, Python, Java, JavaScript, C Sharp. Some of these were in class, some were on their own.
Here's the motivation behind each. Racket for recursion, C for memory management, C++ for object-oriented design, HTML and CSS for web development, although these are not real programming languages, they're markup languages. TCL, I did it in internship and it's f***ed.
useless. Python. I learned this alone and over time, but mostly just for side projects.
Java and JavaScript for backend and frontend web development. And finally, C Sharp, which I do for my full-time job now, but it's essentially Microsoft's version of Java, so let's not talk about it. C and C++ are by far the most useful languages to learn.
After I learned those, I realized most other programming languages are essentially just derivatives of those. Each new programming language essentially takes those and makes some specific task easier. Basically, All these languages share the same ancestor in C and C++.
So clearly you should start by learning these two languages, right? No. These languages are pretty intensive. If you want to do anything like useful or impactful, it either requires one, a lot of code, or two, use of a bunch of libraries that you've never heard of before and honestly are probably not worth learning. Which brings me to my point.
You need to do something useful, but not too useful. Now, hear me out. If you're learning C, it's going to be relatively easy to start solving some basic math problem. And you'll print the solution on the screen.
But all of your code is contained in this little terminal. If you want to make a graphical game or connect to a website or do anything, quote unquote, useful, it'll actually be really hard. Like even for me right now, I would have to do a lot of Googling to even figure out how to do those things.
Essentially if you start with C, anything useful is gonna be too hard and this will be really demotivating. Now let's look at the opposite end of the spectrum. Many students want to get into coaching and the first thing they want to do is learn machine learning.
Here's the thing. Machine learning is super useful in the real world, but it's all advanced math. So if you start with it, you're going to be learning, one, computer science basics, two, Python, for example, and three, advanced math.
advanced math topics all at the same time. And unless you are literally a f***ing genie, you're going to come out of that not really knowing any of the three. The sweet spot is somewhere in the middle.
You need to do something that's useful, but not too useful. Now that we're talking about doing useful things, let's clear up the distinction between coding and programming. Coding is just writing code to solve computer science problems. Let's call them math problems to show the distinction. This is what you need as a prerequisite to learn how to program.
Programming is the ultimate goal. programming is the act of using coding to make programs that solve real problems. You need to learn the fundamentals of coding to know how to program.
Remember when I talked about people starting at machine learning? This is trying to program before you know how to code. And people only solving math problems in C is knowing how to code and never using that to program.
There are tons of tools, use cases, frameworks that surround each coding language. But in the beginning, you kind of need to isolate the coding language itself, learn the basics of that, and then you can take it and learn. learn how to program with.
The easiest thing to start with is probably Python. But honestly, I wouldn't be upset if you picked JavaScript and I'll explain later. Python mostly looks like plain English.
Even if you don't know how to code, you can sort of read it. It's super easy to get started and you can immediately start learning the basics like variables, functions, move quickly into data structures and algorithms. You'll really want to know the basics about types like arrays and the basics of control flow like functions, loops, and even a little bit about classes.
Don't get carried away. You don't need to learn advanced things like inheritance, for example. If you're feeling a little feisty, you might want to learn exceptions, hash maps, maybe sprinkle in a little recursion.
Now, there are plenty of intro to Python courses in the world so I'm not gonna bore you with the details I'm sure you can find that on your own but now that you have a coding language down let's talk about programming so the first thing I would do is take what I've learned and build a website now there are three important aspects to a website there's There's the backend, which kind of manages user data. There's the front end, which is what runs on the user's browser. And then there's the database, which essentially just stores data.
Now we'll start with backend. You're going to want to pick a pretty high level language, either one Python or two JavaScript. The first program I would build would be a basic website.
Now, what type of website? What does that website do? Well, I'll explain that in a minute.
But for now, let's just make a project in that language. Now, when making a backend, you're going to learn concepts like HTTP methods, get, post, for example. Depending on the project, you might be interacting with a data. database once you start to feel comfortable and have your basic back end working then let's try our hand at the front end now on the front end you're gonna be using things like JavaScript HTML CSS This is the reason I said JavaScript is actually a pretty good starting language because you can use it for the back end and the front end.
Now I said each programming language has a bunch of tools and frameworks that make it easier to use. Basically, there's no reason for you to write code that somebody else has already written. The frameworks I would use for these languages would be Python. I would try either Django or Flask.
JavaScript on the back end I would use ExpressJS, which just think of it as simplified Node.js. And on the front end I would use React. And if you need a database, I would try MongoDB. Now anecdotally I can tell you for Python I've seen more jobs listed for Django than for Flask and I've seen more ExpressJS jobs over Django. On the front end, I think React is pretty solid.
After that time, you should learn C and C++ as it'll teach you everything you need to know to learn any other programming language. I love this method because you start learning the practical and marketable stuff immediately, but then you start preparing yourself for the long-term necessities. This keeps your motivation higher and it really just makes you marketable quicker. Now, what website should I build? Think back to useful, but not too useful.
This doesn't need to be very complicated. In fact, it really shouldn't be complicated at all. There's gonna be a lot of new. ideas and concepts thrown at you.
If you try to build the next Tinder or the next Instagram, you're going to end up with no product, no learnings, and no motivation. Now, before I give some concrete examples, and I will, let's talk about what makes a project good in an abstract sense. It's always best to create things that you actually find useful.
I'll give you an example of one of my first side projects. So I created this thing called Spotify to YouTube MP3. In university, I had a trial of Spotify and when it ran out, I was too cheap to buy Spotify. I didn't have any money, but I had 400 plus songs in my playlist. I didn't want to lose all that, so I created a Python program that uses the Spotify API to get those songs and then YouTube's API to download the mp3 version.
Now I had all the same music, but for free. This project was one of the few that I actually finished, and it's one of the few employers loved asking about. Why? Well, one, because it's unique, but two, because I actually used it. I built it for myself.
Other projects I would start and then I would lose motivation and I would never finish. Think a little about some problem that you have in your life that would be nice. nice to know.
Like maybe it's just knowing when your favorite beer is on sale or maybe it's an online clipboard so you don't have to keep messaging yourself random shit on Facebook Messenger all the time. It doesn't have to be relevant for everyone. It really just has to be relevant for you.
Now, if you don't have an idea yet, don't panic. I have a solution for that. You're allowed to follow a tutorial on YouTube or Udemy or any of those sites, but you're not allowed to build the same website as them. For example, if you're following a tutorial on how to build a weather website, instead, try building something like a currency converter.
That's a real example that I did. What's great about that is most of the code and the concepts are going to be the exact same, but it restricts you from being able to copy and paste the solution. Therefore, Therefore, you can follow the tutorial, but you can't copy it.
Now, moving back to C, C++ for a second. The best and most popular languages and frameworks are always going to change. They're changing as we speak right now. Don't underestimate those fundamentals you've learned in C and C++ because ultimately, if you know those well, most other languages are just going to be some subset of those languages.
Also know, you're going to experience the Dunning-Kruger effect. This curve shows when somebody's learning a new skill. At the beginning, they tend to be overconfident in their abilities, When they start to learn more, they see they actually have so much to learn, they quickly lose all their confidence, and it takes them a while to build it back up.
Bear in mind, you're going to go through this process. You're supposed to feel like you're not good enough. You're supposed to feel like you're not smart enough for this.
But trust me, if I can do it, then you can do it. One important resource is hackathons. It's weird to be at a hackathon in the first place, but it's cool to see all of this.
Hackathons are scary because you'll go not knowing much, but people will expose you to things you didn't know you didn't know. They'll help you. build and complete an entire project in 48 hours. They're also just really fun even if the food is actually terrible every single time.
Now don't forget this comes after you learn the basics of coding. Don't try to program before you know how to code and don't waste all of your time coding and not programming. Subscribe, smash the like button, and go break some eggs.