What Programming Language to use for Machine Learning

Affiliate Disclosure: As an Amazon associate I earn from qualifying purchases.

Most beginner programs are faced with the choice of what programming language they should choose. If you are looking to learn machine learning you are more than likely not completely new to programming, and you will have an easier time selecting one for this particular niche. Even though the domain of machine learning is much smaller than programming in general there are still quite a few choices available.

Most common options

The most popular programming languages for machine learning and data science at the moment are:

  1. Python
  2. C++
  3. Mathlab
  4. R

There are others as well, but these are the dominant languages that you will see in online courses as well as in job postings. 

The four languages listed above all have their pros and cons, but only two of them are general purpose languages and can be used for pretty much any programming discipline. C++ and Python are the more common languages out of the four, and Python is probably the most common for machine learning in general.

If you check out the stack overflow 2019 survey, you can also see that Python ranks number 4 as the most popular technology among developers. According to Stack Overflow, python is the fastest growing major programming language. This alone is a great reason for picking Python as the language for machine learning. 

As far as equipment, you should be able to use all the languages above on any machine. If you are interested you can have a look at my resource on the best machine learning laptop

What you should select

In my opinion you should select Python as your language of choice for machine learning. It is the fastest growing language, it is the most common in online courses, it is the most common for job postings, and it is a lot easier to get started with than C++.

Python also has a huge amount of libraries to help with machine learning. Its ease of use and the large tool set that it offers make it the clear choice in my opinion. 

Another reason for using python is that it is a lot easier than C++. C++ has a huge learning curve and even if you are an experienced developer you will have a harder time than with Python. Even if you are a C++ developer in your day job, learning Python is probably the right choice because of its prevalence in the work space. If you want to get a machine learning job then you almost guaranteed have to know python. 

Most training material that you will find also uses Python. As you learn more and more about machine learning you will definitely need to look up a lot of things. Being able to directly use it is a great benefit. If you have to translate it from lets say Python code to C++ code you will not only be slowed down, but you can end up getting stuck a lot more. 

There are also more jobs for Python in general. As of writing this there are 16,267 jobs listed in California when you search for Python. That is a lot. Searching for C++ returns a total of 9,804. That is still a lot but Python has almost twice as many. As a comparison, C# has 3,856 listings, and JavaScript (the most popular language according to Stack Overflow) has 9,179 listings. Based on these numbers you can see an indication that you will be more likely to land a job using Python than C++. Mathlab has only 5 listings, and if you search for R you get 6,353 but I don’t think that is accurate as you are searching for only a letter. 

An exercise you can do is to go to your favorite job website and look up some machine learning jobs for companies that you are interested in. Scan their job postings and see what languages they use. Ultimately I am sure you would like to get a job doing machine learning, and what better than to prepare yourself for the jobs that you are actually interested in. 

What about the other options

Mathlab and R are great languages to know and are heavily used in data science. Although there are lots of projects that use these languages, they are mostly contained to their domain and you would have little use for them outside of them. Both Python and C++ can be used for so much more. You can build websites, GUI programs, and pretty much anything you can think of with those two. 

In conclusion, Python is easier, has more support, has more jobs, and is more used. Those are all reasons for picking Python as your language for machine learning.