If I could go back in time and learn to code, I would do a lot of things differently. If I could sta...
Video Transcript:
with just a laptop internet and lines of code you can create something truly zero to one learning to code is one of the best things you can do if i could go back in time this is exactly how i would do it i'll break up this video into three big chunks the mindset coding and the developer environment everything i'm gonna tell you is paralyzable which means there's no real order and if you're not in college or a boot camp great this video is tailored for you it's definitely harder but if you're willing to put in the work you can definitely learn how to code by yourself in fact if i could go back i don't know if i would have gone to college let's get into it part one your mindset coders think differently we approach our lives and problems in a certain way and i can confidently say my day-to-day life is different now than my software engineer step 1. 1 adopt a coding mindset and what i mean by that is for every problem inefficiency annoyance in your life you need to think there's a solution for this i just need to find it it might take me minutes hours or even days but if i look hard enough if i try hard enough i will find it and that means google is your best friend your toaster is broken all right pull up youtube and start searching the internet modem is blinking yellow google the serial number and start investigating there's a spider on your house and you want to get rid of it yeah i don't know if google can help you there you might just have to move houses and what i'm saying might sound obvious but it took me years to realize not everyone is like this if you were ever wondering why your parents think you're i. t support well here's your answer your parents can google just as well as you can but they don't believe they can and to be a coder you need to believe you can as a fundamental truth because when it's 4 am and you're working on a programming assignment and you've tried everything but you still can't figure out the bug the only thing that'll keep you going is knowing there's a solution you just need to find it and that brings me to the second part of the coding mindset humility trust me when i was in college at ta sessions i'd be yelling at the top of my lungs there's something wrong with my laptop the code is right i don't know what's going on i don't write buggy code the computer is never wrong and the second i realized that and truly internalized it was the day i started growing in my coding journey step 1.
2 learn how to problem solve have you ever wondered how airlines decide which airports to fly from and how shipping providers decide what packages make it on the plane or how classes are scheduled even though there are only so many auditoriums well these are problems solved by algorithms that used to be done by hand i mean some pretty legendary woman got us to the moon with only chalk and blackboards but today the scale is just too massive it would take lifetimes to solve these problems by hand so we code at the end of the day coding is just a tool for problem solving the hard part is the actual problem solving being a good coder means being good at learning picking up new things and technologies quickly understanding that there's a lot out there that you don't know but you can learn it all with some time and patience at every one of my internships and jobs i had no experience with the languages they used c sharp at slumberg and microsoft ruby on rails at gusto and golang get bolt but i learned them all and at hackathons my teammates would want to use buzzwords like machine learning in the cloud and i'd have no idea what they were saying but i'd figure it out and yes you don't have to be a good computer scientist to be a good coder but you do have to be a decent problem solver and hands down the best free resource to improve your problem solving skills is cs50 harvard's introductory computer science course that all incoming freshmen take you have an ivy league education one of the best intro computer science courses out there at your fingertips for free take advantage of it cs50 will give you a broad overview of computer science algorithms and data structures is it necessary to learn how to code no will it help you and accelerate your learning definitely the class is language agnostic you'll be exposed to c sql python javascript html and css all while working on real world problems in biology cryptography finance forensics and gaming what you learn in this course will help you immensely with everything else i'm going to talk about at rice the first computer science class i took freshman year was comp 140 basically rice's version of cs50 and it energized me to continue my coding journey part two learning how to code now that you've adopted the right mindset it's time to learn how to code i can't say the journey will always be rosy but i promise it will be fulfilling step 2. 1 learn one programming language deeply the language you use to learn programming doesn't have to be the same language you eventually use at work or even in your personal projects but it's good to know one language really well like your go-to if you took cs50 you've been exposed to a bunch of languages but for now i'd recommend python it's the most beginner friendly language and for the most part it reads like english the data structures are really intuitive and it's not verbose it isn't typed which isn't ideal but you can always use linters to optionally add typing and this is probably the language you'll want to use for coding interviews so it's good to get comfortable with it now to actually learn coding in python there are so many great resources out there for now you're going to want to focus on syntax and data structures so follow an online course or look up some tutorials on youtube make sure you learn about control flow so if else statements basic logic and or not loops foreign while loops and objects classes and other object-oriented programming principles in my opinion these are the highest yield topics and for data structures don't worry too much about crazy optimized red black trees and whatnot for now focus on hash maps and arrays once you have a basic command of python move on to the next step step 2. 2 learn scripting sometimes there'll be stuff you're doing that will feel really manual like data manipulation or renaming files or sometimes you just want to write code to produce code you can write scripts on your terminal through bash scripts but hopefully by this point you understand some python so you can leverage it to automate some of your daily tasks for example let's say you want to grab data from a csv file and generate an insert sql statement that you can copy paste into your database console and imagine there are no nice libraries that can help you do this it would take hours if you wanted to do this by hand but with a simple python script you can generate this entire command copy paste it into the database console and you're good to go you basically wrote python code to generate an sql query string that's awesome the great thing about scripting is you don't have to spin up a web app or worry about hosting your server you can just write python code and writing more and more python will make you better at it coupled with the coding mindset you now have a practical tool to solve some of your daily problems step 2.
3 create a personal project the first thing i do is sign up for a hackathon in person is best but virtual is fine too this is much like signing up for a marathon so you feel motivated to go out there and train a hackathon will give you the chance to create a project you'll learn a lot you'll work with other people and it'll give you a taste of what real-life software engineering feels like well except real-life software engineering projects aren't completed in 48 hours and you actually have to test your code and you're not as sleep-deprived but you get my point you'll get a chance to create something that you can deliver to customers in this case the judges i've said this many times in other videos the best way to learn programming is by doing and ideally you work on something you're passionate about so pick a topic you're interested in and build something there are a couple things i think are important here first you're going to want to pick a full stack project which means there's a front end a back end some api message passing layer and then a database to actually store the information you can do everything in python if you want through flask or django but i'd actually recommend learning and using javascript javascript is probably one of the most popular languages out there today and it has great support for front end and back end for the front end i'd recommend react and for the back end some framework around node express is a really popular one like python javascript is not tight so i highly recommend using typescript which is actually what industry uses so it'd be a good precursor anyway the awesome thing here is that there are so many stacks you can use mirn is a really popular one but there's no wrong answers just pick one and dive deep for the message passing api layer probably start off with the rest protocol but if you're feeling extra bold give graphql a try and for the database i'd recommend using mongodb which is very javascripty and json-like or you can use a classic relational database like postgres for the back-end server and database feel free to host everything locally but for bonus points see if you can set up your infrastructure in aws azure or some other cloud provider because that's how they do it in industry if you're not feeling particularly inspired here's a project i think gives you the most bang for your buck implement a stateful counter which means the front end will have a number a plus sign and a minus sign to increment and decrement the counter and maybe a reset button to set it back to zero and stateful means if you close the app and reopen it the count should continue from where it left off and this will force you to use a database to actually store the information these are called crud apps for create read update delete the four basic functionalities any feature can have by implementing this you'll get experience across the stack and have a real-world project to show for your efforts step 2. 4 practice for interviews if you're watching this video chances are at some point you want to get a full-time software engineering job and that means you're gonna have to do coding interviews and remember when i said just focus on python syntax and hashmaps and arrays well i wasn't lying by now you have a good grasp of the fundamentals so you're ready to pick up an interview book and start practicing the classic book everyone knows is cracking the coding interview but it's honestly not my favorite the solutions are in java which is completely unnecessary since java is such a verbose language i'd actually recommend elements of python programming since the solutions will be in python and you're already familiar with the language for interviews you'll need to be familiar with strings arrays hash maps trees graphs queues stacks tries and heaps along with some basic algorithms like breadth first search depth first search and some other basic sorts and searches i know it sounds like a lot but you can get there with some practice chances you'll use any of this at the actual job close to zero chances you see these concepts in interviews pretty high you should also learn recursion and practice it don't worry if you struggle i struggle to this day to truly prepare for interviews i'd recommend doing practice problems on league code and using these sites that allow you to mock interview other people and have them mock interview you part three your developer experience now this isn't technically coding but it's almost impossible to code without a solid developer environment and remember there's a stark distinction between writing code just to pass a coding assignment and building something in the real world in a production environment so honestly i think getting comfortable with the tooling you're going to end up using every day is probably the best investment you can make step 3. 1 learn the terminal you're going to code on your laptop right now you probably drag and drop things into windows and right click to find what you were trying to do and don't worry i was just like you but those days are gone or they should be gone if you're trying to seriously code just like command c is way better than right clicking and hitting copy navigating on your laptop through your terminal is way more efficient than using the user interface you know those hackers you see in movies coding really fast well all that is fake but the one thing they got right is that they're using the terminal and i promise you sooner or later you're gonna have to get comfortable with the terminal so you might as well start now couple things here if you're on windows i'm just gonna say it the command line is not it the linux flavoring is way nicer so i'd highly recommend you get the bash subsystem for linux and if you're on mac i'd highly recommend using itunes ii it's way nicer than the default terminal now you have a couple options you can use the default shell which is usually bash or you can use some wrapper like zish oh my zis or fish no hard opinions here but just pick one and learn it and if it makes a difference i personally use oh my zish get comfortable with the package manager and commands like sudo ls mv rm and so on and the best way to do this is to force yourself to only use the terminal to navigate on your laptop it's like when right-handed people want to become ambidextrous they start brushing with their left hand let's say you want to move a bunch of files to a new directory and then open that folder in an editor cool you can do it on the terminal the terminal can be gnarly and you might have to google a bunch and resolve all these dependencies but that's great more practice step 3.
2 learn your way around an editor i'm not a vim or emax power user and i'm not going to debate you on tabs versus spaces i mean i do not get why anyone would use spaces over tabs i mean why not just use vim over emacs i do use vim over emac oh god help us but trust me you're going to want to know your way around a coding editor my go-to in college was sublime but honestly looking back hands down the best open source editor out there today is vs code so download it and start navigating around check out some extensions like prettier and eslint and browse through some themes and other settings and really just get comfortable with the whole environment i'd also recommend any jetbrains ide like intellij for java or goland for golang you're gonna have to buy a license but these editors are powerful and they can level up your coding ability step 3.