Which programming language should you learn first?
Spoiler: I answer this question with a series of questions
People eager to learn programming often ask me which programming language they should learn first. There are plenty of “wrong” answers to this question and a few good answers. Like, you really can’t go wrong with learning Python or JavaScript these days, but you probably shouldn’t start by learning FORTRAN. However, instead of giving them a straight answer, I ask them a series of questions. Here are some of them.
Why do you want to learn to code? Do you have time to learn how to code? Do you have any friends who know how to code? Or do you have friends that also want to learn how to code? Does your current employer have coding needs where you can get practical experience?
Most people who ask me about learning to code are ultimately seeking to gain employment in IT/Tech. They usually know at least one person who knows how to code (they know me after all), but often don’t know anyone else looking to learn (sometimes they do). Most of them are not working in jobs where it wouldn’t be easy to apply their coding skills. Almost all of them dramatically underestimate the level of effort most people need to learn programming.
Most them don’t know that IT/Tech consists of a whole lot more than just programming/software engineering. But there are other ways to get into tech than just knowing how to code! I firmly believe that coding is the most important skill for anyone in IT/Tech, but a systems administrator doesn’t need the same level of proficiency as a software engineer. A support engineer doesn’t necessarily need to have strong coding skills. A DBA mostly uses SQL. A product manager often doesn’t need to know how to code at all. A cloud administrator probably spends more time reading documentation and writing short scripts than full software. etc.
So before I recommend a programming language to start with, I often recommend taking a different path in tech than getting straight into software engineering. I encourage them to get into the industry in a role where coding skills are secondary and grow from there.
But if they’ve determined that they want to learn to code, here is some additional information I tell them.
The most important aid you can get in learning to code is a mentor. Or even better find several mentors. You should reach out to your mentor when you need help. There’s a science to asking for help though. I’ll write a post later about this, but it basically boils down to “state your goal” and “try to be specific” when stating your problem. The reason for this is that your mentor is busy. Open ended questions take time to answer, but answering a specific question can often be written in 10 minutes or less and sent over email. On the other hand, a specific question with no context can be frustrating to answer because maybe the wrong question is being asked.
More importantly, a mentor can help you direct your growth. Most technical knowledge is valuable, but some knowledge is way more valuable for you than other knowledge. A mentor can help you choose the best path.
The second most important aid you can get in learning to code are learning peers. These are people that are on the journey with you. These people will help keep you sane during the process. One thing to remember though is everyone learns at a different pace. If your peers are ahead of you or picking up stuff quicker than you, do not let that bother you. In fact, peers who are ahead of you can become mentors. That’s a good thing!
Completing practical projects is the best way to learn programming. Notice I didn’t say this should be the only method. It also shouldn’t even be your first method. Before trying to tackle a project, you should first go over the introductory tutorial for your chosen programming language. You should then dive deeper into the documentation. Test what you learn with small snippets of code. Watch a Twitch stream of someone coding with your chosen language. After you’ve done all this, then it is time to pick a project and see it to completion.
At this point, you might notice that this method of learning suspiciously resembles school/college. Well, yeah it does. College is a good (but expensive in both time and money) way to learn. Self-driven learning is much cheaper in terms of money, but not everyone can do it.
Unfortunately, many people looking to get into IT/Tech don’t have friends that are already in the industry or looking to get into the industry. So you might think much of the above doesn’t apply to you. But it still does!
Find online communities and influencers1 that you enjoy and provide value to you. Find virtual peers and mentors this way. Follow tech bloggers like me. Twitter/Slack/Discord/Telegram groups that focus on IT/Tech are great resources. Traditional forums are often great too.
So with all this said, I feel that I am ready to sort of answer the question of which programming language to start with. If know someone who is willing to mentor you, pick a language they know well because that is what they’ll be able to best help you with. If your have a peer group that leans toward a particular language, pick that language! If you find an online community that you find compelling, choose a programming language that community prefers.
If you still haven’t figured out which language to pick, here are some suggestions sorted by focus. I also list some languages I recommend beginners to avoid.
Data Science
Choose one of these languages if you work with datasets.
Python - Great language for data science. Numpy and Pandas are your friends and so is Jupyter notebooks. I would recommend Python over R because Python is used widely in the industry and not just for data science. Honestly, Python could show up in every category.
R - statisticians love R and use it. RNotebooks is pretty cool too. I used it a good bit while I was studying at Georgia Tech. Ultimately, if you’re getting into data science, you’ll need to know R.
Software Engineering
We write large software products and services.
Java - boring but reliable OOP language that is EVERYWHERE. Java has a ton of language features, so mastering it will teach you almost everything you need to know about programming (except for pointers). Will also teach you to fear Null. Once you’ve become competent with Java you should consider moving on to Kotlin.
Go - simple language that will force you to think about error handling and introduce you to the dangers of pointers. Excellent language for learning the basics of programming because it doesn’t give you as many shortcuts that languages like Python do. Go is probably my favorite language, and I miss it.
SQL - all software engineers need to know how to work with databases. Sure, NoSQL databases are an option these days but SQL can even be used with DynamoDB. SQL is a great second language to learn.
Avoid C/C++ people will hate me for this, but you shouldn’t start with these languages. A vast amount of incredibly useful software is written in these languages, and you should consider learning them if you want to become an open source contributor to incredible projects like the Linux kernel or Git. But these languages are hard.
Game Development
Game developers create video games. I actually don’t know much about game development, so I’ll do my best with this one.
yiiiikes. C++ is apparently the most common language used for game programming. I am so sorry. Maybe choose Web development instead?
C# - a good alternative and similar to Java. C# is used for programming in Unity. It is much easier to write than C++. C# was also the first programming language I learned, so it holds a special place in my heart. Please start with C# instead of C++.
Linux Systems Administrator
A linux systems administrator usually is writing scripts that are under 10,000 lines long. Often, they are much shorter.
BASH - the bourn again shell. Anyone who wants to administer Linux systems should learn bash. Looping is painful, but piping commands together is awesome.
Python - you’ll use Python for any task too frustrating to complete with BASH (or at least that is what I do).
Avoid Perl. I don’t know how this language happened, but it is ugly.
DevOps Engineer
A DevOps Engineer deploys, updates, and monitors live software services. They also tend to get paged at 2:00 am.
BASH - All DevOps engineers need to know some BASH.
Ansible - not really a language, but it sort of is. Lets you make your BASH scripts run on thousands of machines.
Go - Terraform, Docker, and Kubernetes are both written in Go. Chances are, you’ll extend one of these and doing so will require you to write Go. Go is also simple enough that learning it is much easier than complicated languages like Java.
Python - seeing a pattern yet?
Web Development
Web developers make Websites. This includes the code that runs on the frontend and on the server. A couple of languages are widely used for both.
JavaScript - all the code running in your browser is JavaScript. Additionally, JavaScript is widely used for server side development as well.
TypeScript - makes JavaScript better and safer. It’s probably better to start with JavaScript though and learn TypeScript as a second language. Anything JavaScript can do, TS can do better!
Database Administrator
A DBA works with relationship database management systems like Postgresql or MySQL.
SQL - has many variants, but the base language is generally the same or similar. Watch out for how different SQL variants use quotes.
I hope you enjoyed reading these suggestions. Python of course appears the most on the list. If you want to learn a language and be effective with it fast, then Python is probably a good bet. However, there are many programming language features and concepts that Python will not teach you. Things like pointers, memory allocation, static types etc just don’t exist in Python. A language like Java would give you a more complete experience.
One thing to remember is that you don’t have to wait until you master a language before learning another one. Instead, focus on becoming proficient. Once proficient, there’s no reason to not try picking up another language. I guarantee you the second one will be easier than the first (unless you started with Python and then try C).
Once you’ve picked up a few language, you’ll want to start learning about Design Patterns2. Or, you might read up on why many Design Patterns are now much, much easier to implement due to functional programming concepts becoming so ubiquitous.
I feel like the term “influencer” has a negative connotation with it. I don’t mean it in a negative way though.
Design patterns are mostly just applicable for software engineers and Web developers. I assume they are important for Game development as well, but I have no idea.
I really enjoyed reading this! Nice work