In this blog, I want to walk you through how I've went about learning a new programming language. The way I've done it may not 100% work for you, but it may give you some ideas.
Deciding What Language to Learn
The whole idea of learning a new programming language is to solve a problem. The first thing you need to ask yourself is what problem am I trying to solve? For me, I have a few reasons. As I'm focused on the cloud and DevOps space, 90% of my code is written for automation and helping applications deploy fast.
Some of the reasons for you may include:
- Simply to learn something new. Knowledge is power, so they say. If you're passionate about development, it's also just extremely fun. Learning a new programming language opens up your mind to new possibilities and opens up new doors.
Figuring Out Where to Start
Whether you learn better from videos, books, Googling around, or putting some code into an editor and seeing what works, there are a ton of different ways to learn.
var output = 'Hello World' console.log(output)
For myself, I personally like to:
- The next step is to find a course or a book, depending on the learning style you prefer. I enjoy either having a video up next to my code editor, or having an eBook up next to my code editor on the same screen, or on a different screen. It makes learning a bit easier because that way, you don't have to keep looking down at a book and up at a screen.
Now it's time to start learning, but don't stress yourself out. You don't need to learn a new programming language in a day. Figure out what works best for you. Maybe that's 30 minutes per day or two hours per day, there's no right or wrong answer. All of us, as humans, have a specific amount of information that we can take in per day.
While you're in the learning phase, make sure you stay hands-on. Don't just watch the videos or read the book and expect to understand the programming language. Ensure that hands are on the keyboard and you are typing away. Truthfully, the best way to learn a new programming language, or to learn anything new in general, is by doing.
While you're learning, reach out to peers and other professionals in the community. There's nothing like working on an issue for four hours that's a simple fix or that someone already knows. It's definitely good to troubleshoot an issue, but there is no problem with reaching out for help. When you are learning something new, like an entirely different programming language, the community is your best friend.
Picking an Idea
Once you're ready, pick an idea! Maybe you want to automate something on Azure, like listing virtual machines. The important part here is the idea doesn't have to be to create the next social media platform. It's really about learning, understanding, and most importantly, having fun.
An idea can come in all shapes and sizes. For example, because I'm in the DevOps space as an Azure Developer, the first thing that comes to my mind when programming is how can I make interacting with Azure easier and repeatable? This, again, can and will come in all shapes and sizes.
Once you pick an idea, remember the following:
- What packages/libraries do you need? For example, if you're working with Azure, do you have the Azure SDK installed for the specific programming language?
- How do you run the code and test it?
- What editor do you use? (VS Code for example)
Sharing It with the World
Now that you wrote some code, it's time to figure out a place to store it. If you just decide to leave it on a desktop or some other folder, there are a few issues:
- It's not in source control, so there is no working history or saved copy.
- If the computer has a hard drive failure, for example, that code is gone.
- The code isn't out there for the world to see.
One of the things I love to do when writing code is get a few examples of what others have done. Not literally copy/paste, but maybe take a look at the way a person wrote a
for loop or some logic in the code that may help my code.
Even if the code is one line or 500 lines, store it in a source control like GitHub for others to use and see. Storing code in a public source control also helps in letting the world see what you're doing, which can lead to new opportunities.
Just remember to have fun. The biggest part about learning anything in tech for someone that enjoys it, is to really love the process. Learning new information and putting it to practice is supposed to be fun and rewarding. Just have fun.