It was Thursday night. I was laying in bed and thinking to myself hm, I really want to learn a new language. I woke up Friday morning and started diving into JavaScript. If you aren't aware of JavaScript, it's one of the languages that helped make websites on the internet possible.

JavaScript (JS) is typically used for web-based applications, but it can absolutely be used for backend development and automation/scripting as well. In fact, Azure has a pretty solid JavaScript SDK that you can use to do things like create virtual machines, for example.

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:

  • To deploy an application with DevOps principles, you need an application to deploy. Because of that, you need to know how to build a small application. Something like JavaScript or Python is great for a tiny web application to deploy and test.
  • To automate, typically means to write code for the automation. A language like JavaScript is great for automation and scripting. Because JS is so popular, there are tons of SDKs out there to use, including the JavaScript SDK for Azure.
  • 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:

  • Google around just a little bit, but ensure I don't overwhelm myself with verbiage and what things are called. For example, in Python (one of the languages I program in and LOVE) calls non-changing values Tuples, whereas JavaScript (and many other languages) call them constants. Things like that can make your brain fry a bit faster because we, as humans, get comfortable with the way something is called. It's like a car being called a car then one day being called a hipshataey (is that a word yet?).
  • Type some code out on an editor and see what works, what libraries/modules I need, and how to actually run the code. For example, with PowerShell in Visual Studio Code (VS Code), you can highlight the code --> right click --> Run Selection. With JavaScript in VS Code, that option isn't there. You'll have to do something like press F5 to run and debug. At this stage, the code is pretty basic. Things like variables and printing random strings to the console.
  • 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.

Learning

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.

Reaching Out

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:

  • How do you authenticate to the platform with the programming language? For example, how do you authenticate to Azure with Javascript?
  • 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.

Conclusion

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.