Why write this? While there are so many great tutorials on the internet, they all seem to dive into the code, rather than explaining what is going on from a ten thousand foot view and why you need to do it the way they prescribe.
Why Python?
If you ask people around you, their knee-jerk reaction might be to recommend Python as your first coding language — it’s easy to learn and is very popular (meaning well-maintained libraries and forum support).
However, the first thing to know is: Your first language 100% doesn’t have to be Python. In fact..
You can build anything you dream up with whichever language you want.
Even though Python is known for data things, want to build a dashboard or app with Python? Here’s a bunch of websites built with a Python library called Streamlit.
Even though Javascript is known for web platforms and apps, want to analyze massive amounts of text with Javascript? Here’s a list of libraries to get you started (we wrote this before LLMs, but ChatGPT for example has documentation for node (Javascript), Python, and curl (via command line).
In other words, you can build anything with any language. However, keep in mind it’s a pain to write things from scratch, and you’ll want a language that is widely used with many well maintained libraries that you can plug and play into your own projects.
This means that the overly-complicated advice you’re getting from your friend who lives and breathes code is probably not wrong… It’s just unnecessarily complicated. Check out this Reddit thread dishing on someone’s overly complicated flowchart to help beginners know where to start coding.
Here’s an over-simplified, 101 infographic on what language to start with. If you want to learn more, head to r/learnprogramming and read the Getting Started page.
As an fyi, anyone who is opinionated about coding will most likely not like this infographic. For example, most of the internet runs on Wordpress and companies like Facebook build their front-end (or at least have for years) with PHP (if you’re interested in Facebook and it’s PHP/Javascript journey, read their blog here). The key takeaway from this infographic is:
- Think about what you want to build first. Or if you are considering coding for a career, think about the kind of work you want to do and the companies you want to work at.
- Just get started. In the end, you’ll use more than one language. Once you know one, it’s easier to pick up another.
- “Knowing” how to code is a lot more than the syntax (i.e. the grammar and punctuation of coding). It’s also knowing how to search Google for the right answer, how to skim forums, skim error messages, how to break down a problem into smaller steps, think logically to architect your solution. Getting stuck picking a language is the last place you want to be. Choose a point on the horizon (a project to build) and dive in.
Wrapping your mind around the programming ecosystem
So what am I actually learning?
When I first started coding, I thought programing languages were mysterious, very official languages set in stone. But they’re actually more like Wikipedia. Did you know that there’s only a 5,000 who are actively managing Wikipedia? (If interested, read more about them: Wikipedians).
In the same way, programming languages are maintained and added to by a relatively small group of developers and communities (but some are also supported by companies. For example, Microsoft backs TypeScript (a “version” of JavaScript and Facebook supports React (a library people use to make apps with). In other words, the syntax and functions and libraries you’ll be using to build were just made up by someone. In the future, there may be “breaking changes” and you’ll have to learn the new way of doing things. Again, it’s better to dive in than to fret about what to start with. For example:
1# In Python, you use # to add comments (lines in code that aren't run by the computer)
2# To write something in Python 2, you do the following:
3print "Hello world"
4
5# But in Python 3, you do this:
6print("Hello world")
7
8// In JavaScript, you use // and write:
9console.log("Hello world");
10
11// In Java, it's:
12System.out.println("Hello world");
I hope you get the idea.^
So some quick facts on coding:
- Code languages are constantly going up and down in popularity, and you’ll probably have to learn a couple more languages as your preferred language gets used less. However, for DIY projects with easy languages to learn: Python and Javascript are great and aren’t going anywhere anytime soon. Here’s a bar chart race of the most popular languages.
- You are most likely choosing to use a specific programming language or framework because of the large ecosystem of libraries (the tools that make up your toolkit) that are continuously being updated and the active troubleshooting community on sites like StackOverflow.
- Tell me more about this “community.” Well, most things you’re going to build will be cobbled together like a copy-paste Frankenstein. And most of the code you’re going to be copy-pasting is written by random people/companies who upload their code so that you and others (and themselves) can benefit. Why do they share with the world? This confused me too when I first started coding too. Definitely read up on open-source, it’s a fascinating concept to anyone not familiar.
Tl;dr — there is a small subset of programmers who are responsible for most of the tools that you’re going to be using. They are real people that you can actually message when you are stuck or encounter a bug — and if it’s not a question that was easily Googleable, they will actually appreciate your messages because you’re helping them find and fix bugs.
Most of coding is Googling errors and reading documentation of an unfamiliar library. The most important asset a coder can have is the ability to see the larger picture and lay out a gameplan to build the project. It may sound silly now, but code hygiene, foldering, and code performance and optimization will really show the maturity of a coder — not the number of lines.
Breaking down what actually happens line-by-line in an example code snippet
What is a…
IDE
An IDE is a fancy text-editing program (e.g. Microsoft Word) with lots of bells and whistles. Fundamentally, it’s going to color your code to make it easier to read and do other cool things that make your life easier (e.g. help you catch issues with your code, show levels of indentation, reformat, help you batch change specific words across all your files, etc).
There is no best IDE. If you have the money, go with something from JetBrains (free for students). Else, go with VSCode. It supports all languages and it’s only getting better and better (Microsoft is really putting a lot of work into it).
Some people are going to tell you to use a text editor like Sublime or Text Edit. Don’t do this, you’ll spend hours trying to configure it to run code. Just watch a Youtube video to familiarize yourself with VSCode (watch a video for the specific language you want to use since it will tell you what plugins to install specific to your langauge) or WebStorm/PyCharm (from Jetbrains).
If you’re doing a lot of work with data science specifically, consider Spyder instead of VSCode. It has a great variable explorer view and is pre-configured to let you run code line by line (rather than running the whole script every time and waiting for bugs).
Library/Package/Framework/Repository
These terms overlap way too much and are very similar. Good explainer here from KimConnect:
Just know that when someone says “repo” — they mean a repository, which is a storage location of that project and you have control over older/new versions of that project.
You’ll be using a lot of libraries — which are just chunks of reusable code that someone smart coded. And that smart person could be you! It’s ridiculously easy to publish a library for private or public use, and because of that, it’s very important you check if a library is currently being maintained (aka it’s not going to break on you because it’s way outdated).
Note: when you’re about to install an unfamiliar library, first go to the source code and check if it’s being maintained. AKA people pushing updates to the repository recently. Here’s an example:
Checking if a repo is maintained.
AI
While Large Language Models are popular now, they have yet to find a firm product/market fit and AI/machine learning pre-ChatGPT is still very important to know (and you might be able to go build a business on it easier than with an LLM wrapper). Plus, it’s easy! There are so many repos and tutorials online using libraries like scikit-learn or Pytorch(makes “AI” easy and copy-pastable) that you can get started with.
As a note: When you’re getting started, it’s important not to avoid big words like AI. Instead, think of it as just another tool in your toolkit to solve specific problems. It sounds cool to “use AI” in your project, but fundamentally, AI is a new way of solving old problems and the old ways would probably work for 90% of the projects you’re dreaming up.
Dark mode
People love dark mode lol. There’s really no right or wrong here, just for people staring at their screens for many, many hours, dark mode is easier to look at.
Git & Github
When you have code that multiple people are working on, it’s important to uphold version control — AKA who, what, when, why changes to the code were made. Git is the most popular version control system out there (VCS) and Github is a company (owned by Microsoft) that lets developers manage their code (which Microsoft then uses — surprise surprise — to train their LLMs).
Git might seem intimidating, but it’s worth learning and ChatGPT is always there to help. If you are just starting, consider just using Github Desktop, there’s really no shame in using it and it’s very convenient.
Why does everyone have Java on their resume?
There is a big mismatch between what schools are teaching and what’s “hot” in the private sector. A lot of schools are going to start out by teaching Java for computer science majors or R for statistics students. Nothing wrong with these! Well maybe R… just learn Python lol. You’re going to make the switch eventually if you start with R. But that’s why everyone has Java on their resume.
Googling stuff
Knowing what words to use when Googling for something you’re stuck on is super important. Also, note that ChatGPT/Gemini/etc are dumb in that if you’re not getting the right answer from them after attempt #3 → Google the issue and find a thread on StackOverflow. Otherwise, you’ll be aggravated and stuck while ChatGPT continues to return outdated/not-thinking suggestions to mess up your codebase.
For Googling, there’s no correct way to learn what words to use, but generally my searches include the following at the end of the search:
- “stackoverflow” — if ChatGPT is giving bad answers (which it often does, you’ll get a feel for what is good to ask it and what probably won’t work), someone else on Earth has probably had the same issue as you and it’s probably on StackOverflow. For something specific to a library (e.g. arbitrary lags in API calls for GPT-4) might not be on StackOverflow, so make sure to Google search to check if there’s a discussion on your issue on OpenAI’s forum (OpenAI is just an example, but a lot of companies are doing this, where you end up finding the right discussion on the company’s own forum rather than on StackOverflow).
- “gist” — this is a short code snippet the people save and might have the answer pre-written for you 🤘
Steps to get started
- Download an IDE (VSCode, Webstorm, Pycharm/Spyder)
- Watch a youtube video to get the IDE set up
- Decide on a project
- Start googling and searching youtube on how to get started
And This is Where Most People Get Stuck
You set your IDE up. You ran “Hello world.” Now what?
Now you need a project! Something to accomplish that would be meaningful to you. It’s not a bad idea to try some lessons on the Odin Project or CodeAcademy to get the hang of writing code — but to actually learn and follow through, you’ll need a project that you become invested in (Duolingo-ing forever does not make you functionally fluent in a language — same thing for coding).
Two places to look for ideas:
- Your day-to-day work. Is there something you can automate to make your life easier? Auto-cleaning a spreadsheet? Pulling today’s stock numbers? Doing your homework?
- Googing “awesome” lists online. These are lists of lists of projects already built, libraries to use, etc. Maybe copy paste one of them and plug it into ChatGPT with some basic ideas you have and ChatGPT can return some augmented ideas of things to build. Here’s some examples: one list and another list and another and another.