We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Start learning a new programming language, today
December is just around the corner. In a few hours, the first puzzle of this year's Advent of Code will unlock. Every year, I take this great opportunity to learn a new programming language (and share my journey on GitHub). Why you should also take this opportunity, I will tell you now.
If you have never heard about it: Advent of Code is a coding challenge, in which each day in December, from the 1st to the 25th, a new puzzle is published. The puzzles start out very easily, but can become quite challenging later.
While most of them are best suited to be solved by programming, you can solve those puzzles however you like. In the end, you only have to produce a number or a word as solution. How you found that solution is not relevant to the challenge. This is a big deal, because it allows you to freely pick whatever you like as an instrument to approach them. I have seen solutions on paper, in spreadsheets, and in basically every programming language on the planet.
This is why you are free to pick any programming language you want to learn. You are not limited to what the creator of Advent of Code, Eric Wastl, has thought of supporting. You can go crazy and try out something new.
But why exactly would you make the effort to learn a new language?
Your knowledge portfolio
In the book The Pragmatic Programmer, Dave Thomas and Andy Hunt make a case that you should treat your knowledge in the same way as financial investments. Invest regularly, diversify your investments, and look out for something that might become a lot more valuable in the future.
Unfortunately, trends in the programming space are very fast lived. Languages that were very popular recently might not be asked for anymore. So to stay up to date and in demand, you have to invest some time to broaden your knowledge. It will show your ability and willingness to employers to increase your worth, giving you a better position in salary negotiations and interviews. It can even open up completely new opportunities for you. I wouldn't have gotten the job that I have today if I hadn't learned Rust a few years ago during Advent of Code.
Learn at least one new language every year
Different languages solve the same problems in different ways. By learning several different approaches, you can help broaden your thinking and avoid getting stuck in a rut.
By learning a new language, not only do you stay flexible in your mind, but you also get to think about solving problems in different ways. Even if you do not plan to use the new language right away, by adding a distinct perspective to your thinking, it will improve how you use other languages. It will improve the quality of all the code you write. And it will make it easier for you to better understand code that someone else has written.
Fortunately, with every programming language you know, it becomes a bit easier to learn the next one. When you only know one language, it can seem quite scary to step out from the familiar environment into the unknown. But it is a very important step to broaden your portfolio and to expand your toolbox.
Build a polyglot toolbox
Every programming language has a diverse set of features that you can use. In each language, some solutions are straightforward, others problems might be more difficult to solve. Certain paths you are used to take might be straight up impossible, so you will be forced to look for a completely different approach.
For example, if you only know loops, learning a functional language that enforces immutability will make you use recursion to implement many algorithms. Or if you are used to pass around mutable variables a lot, trying to write code in Rust will quickly train you to be more conscious of memory ownership.
This is also why Advent of Code is such an awesome tool for learning a language from zero. It usually starts with very simple problems that can be solved in a single loop or recursion. But every day, there will be a new algorithm to implement, a new data structure you might need to efficiently solve the puzzle, or a new tool to discover, that can help you find out why your solution is not working.
If you get stuck, there is an abundance of programmers on Reddit that can help you. Sometimes it is enough to just scroll through the thread titles for a given day to help your brain spark the solving idea. There is also a thread each day where a lot of people share their solutions, in each and every imaginable language.
Take some time after solving the puzzle to share your solution and read through other solutions. Look especially for solutions in the language that you are learning. You will be familiar with the problem, but there is so much to learn from just reading different solutions to the same problem, written by different people.
It is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail."
~Abraham Maslow
Please don't be the programmer who writes everything in JavaScript, because it is the only language you know. It is great to always have a fitting tool in your toolbox to solve a problem. And there are a lot of languages out there that are very good at solving various different problems. Often, you might not even realize what you will get out of learning another language in the end. But most importantly, you will less likely waste a decade being stuck thinking in a single paradigm.
So which language should you pick up next?
One new aspect
There are so many options to choose from, some of them are more familiar, some of them might seem completely alien. You don't have to go completely crazy. But pick a language that has at least one aspect that is new for you.
If you only know object oriented languages like Java, try learning a functional language like Clojure next, without leaving the familiar environment of the JVM. If you have only worked with a dynamically typed language like Elixir, pick a statically typed language like Gleam. If you are used to code in C, try convincing the borrow checker in Rust that your code is fine.
By changing the paradigm deliberately, your perspective will broaden. You will get stuck from time to time and you will have to read some documentation or look for help elsewhere. But by solving actual problems on your own, instead of just repeating tutorial exercises, it will stick. I don't think there is a better way to learn a new language than by solving incrementally harder problems, on your own, like you do during Advent of Code.
Create a challenge for yourself
If you already know a bunch of languages, just invent a challenge for yourself. Try to get on the leaderboard. Try solving everything without using external libraries. Code golf in as few bytes as possible. Optimize your solution to make it run in under a second (or millisecond, depending on the task). Upping the ante on Reddit can give you a lot more ideas for different challenges.
Another option is to try out a new framework. There are many fantasy consoles out there like the TIC-80, that give you a playful environment while supporting a wide range of languages. They make it very easy to get started, but give you some nice options to build cute visualizations for your solutions later.
One last thing
Don't get discouraged if you can't solve every puzzle right away on your own. Look for help if you get stuck. In the end, you don't benefit if you only get frustrated and drop out as a result. But set aside some time every day to solve at least the first part of each puzzle. Your mental capacity to crunch on problems like these is limited, so try to make daily use of it. I have seen too many people procrastinate, and then get overwhelmed by the sheer amount they planned to solve over the weekend. As a result most of them give up completely after just a few days.
Now make your choice, start learning, and have fun!