How To Learn A New Programming Language

Before you start learning the syntax, quirks, and features of a new programming language it will be better to first learn how to program/code. Programming is the process of designing and building a piece of software to perform a specific task. You will learn how to analyze and generate appropriate algorithms to complete the assigned task and then implement such algorithms in a programming language.

I am not saying to go and become a computer scientist, but taking a few foundational courses will go a long way in making you a better programmer/coder. A couple of good resources to do so are CodecademyCode.org, or a computer science course like Harvard’s CS50

Once you know the foundations of coding, you will most likely want/need to learn a new programming language. Maybe the programming language you learned first is not suitable for the task/project you want to do, or you want to learn another programming language out of curiosity.  

I will show you the approach that I follow when I am learning a new programming language. I currently know how to program in JavaScript, Python, and Java (My first programming language, though I do not use it anymore). 

Recently I started learning Go, and I am following the two simple steps highlighted below. NOTE: Even though they are simple it does not make them easy and fast to do. You will still need to put in the work and time to learn them. 

1) Learn the syntax

You might be thinking, “I obviously will need to learn the syntax. WTF, you think I am stupid?”. By learning the syntax, I am not just saying the basics like if-else statements, for-while loops, assigning variables, basic data structures, etc.

Depending on your previously known programming language, the differences in syntax could be significant. For example, you come from a dynamically typed language (Javascript) to a statically typed language (Java). Or an interpreted language (Python) to a compiled language (Go). 

Every programming language has its unique features. Make sure you learn them. It doesn’t make sense to learn the basic syntax only, which most languages have in common. The power of learning a new programming language comes when you apply the best language for the specific task/problem. For example, a powerful feature of Go is its concurrency support with “Goroutines.” It basically means that Go can deal with lots of things at once. It makes Go very good for building massive networking and web software (Created by Google for this use case). Another cool feature is its ability to easily compile for different Operating Systems, making it very good for building malware *cough*, I mean Red Team tools ;).

Hopefully, you get the point. Learning the basic syntax will probably take you a day at most. Challenge yourself and study the specific features that make the programming language you are learning unique. 

2) Build Non-Trivial Projects

I believe that people learn a new programming language by actually building non-trivial software with it. By non-trivial, I mean programs that are not some basic command-line program with barely 100 lines of code. Don’t get me wrong, these simple programs are great when you are learning the basic syntax, but to be any good with the new programming language, you will need to build more complex software. 

After going over the theory of learning the syntax and features, it is time to put your hands on the keyboard and start building software. You should already know the features that make the programming language you are learning especially good and unique. The specific project varies widely depending on the language you are learning. For example, if you are learning Python, you can start by building some scripts to help you automatize tasks. Also can do some Data Science or Machine Learning projects. With JavaScript, you can create a full-stack web application (E-commerce site, social network, etc.)

It does not have to be clean code and without bugs. At the end of the day, you are starting to learn it. Practice Makes Perfect! Ideally, you would get somebody else to look at the project and give you some feedback.

If you have a project that you want me to give you feedback on, feel free to reach on the contact form or my social media.

Eat, Sleep, Code, Repeat