What Language Should You Learn For Data Science In 2021?
By: Emmett Boudreau
Tags: Machine Learning, Python, Data Science, R, Programming

Python

A new programmer in most fields, whether Dev-Ops, software-engineering, or even web-development might want to start learning how to program in the Python programming language. Not only is Python a diverse programming language with a lot of capabilities outside of Data Science, it is also likely one of the best around for high-level Data Analysis.

With packages like Pandas, SkLearn, Tensorflow, Keras, NumPy, and so many more, Python’s ecosystem topples that of most competitors. That being said, while some might prefer the syntax of other languages, it is hard to argue with just the shear amount of packages available for this programming language! Fortunately, the solution for many languages like R and Julia have packages for calling Python packages, usually with C as both are LLVM-based and share a similar architecture with C in-terms of compilers.

Other than that, Python has fantastic numerical packages. A great example of this is NumPy, of course, which is a go-to package for linear algebra in Python. Pandas is also great for handling data, and in my personal opinion is somewhat unrivaled in terms of user-friendliness. If you’d like to get familiar with some cool Pandas tricks, I have an article where I talk about some of my favorites you can check out here:

The biggest disadvantage to Python is certainly going to speed. However, given that Python is interpreted by an LLVM-based language, C, it will be universally extensible among other languages that use this compiler library. This is what gives Python the real edge over R, and can pin it pretty close to other, sometimes lower-level, programming languages. This is certainly a great advantage for Python, as rather than acting like an interpreted scripting language, it acts more like an application programming interface (API) for C-based module calls.

R

Among the most popular choices for Data Science languages is the R programming. R is a great programming language that is different in paradigm to a lot of other languages that most programmers use, and will certainly teach a lot with that paradigm. R also has a great ecosystem for Data Science.

While Python has over 200,000 registered packages — a lot more than R, R is by nature meant to be a more statistically-oriented language. That being said, R has a lot of venerable and proven tools available such as gleam and ggplot2. There are also a lot more great packages that have originated in R and are now expanded to various programming languages and packages.

R’s biggest downside is probably going to be its speed. While Python is certainly not a very fast language, its interpretation by C makes it incredibly viable to run C code as Python modules. That being said, more analytical and visualization-based Data Scientists certainly could prefer the declarative, functional syntax of R while still compiling fully-built applications. If the reason to use R is not to use it professionally, or deploy it into production, then it could certainly still serve as a prominent learning experience.

Recently in Data Science, R has certainly taken a back-seat to Python. I think the reasons are certainly valid and I certainly love both languages for their capabilities in different aspects. Both are certainly worth picking up. If you’d like to read another article about R and Python’s popularity compared, I wrote one you could check out!:

While R is a great language for statistics, data-analysis, and machine-learning, it is not without its problems. Of course, the elephant in the room is going to be the speed of the language. Some Data Scientists also never need to run thread-hungry machine-learning algorithms. That being said, there are ways that R can still be worked with for just about anything in Data Science, though likely not without some issue. However, if you are like me and obsessed with machine-learning as well, a newer programming language, Julia, which is a compiled JIT language revered for its speed.

Julia

If there is one thing I can certainly say I am excited about in regard to the future of machine-learning, it is without a doubt the Julia programming language and its respective ecosystem. Julia is a high-performance compiled programming language that uses multiple dispatch as a paradigm. Julia is a programming language that can take the simple handling of types that programmers are used to in typical programming languages, and turn it completely on its head. If you’d like to learn more about how I came to fall in love with this programming language, I have a detailed expression of my love given in this wonderful article here:

Julia’s biggest advantage to its competitors is certainly speed. While Julia is a language with a focus on the perfect paradigm for mathematical computing, it goes without saying that speed was part of that equation. Julia’s speed can often rival C, and this is something that is revered by many in the Data Science community as a potential reason to adopt it.

That being said, I think something that is also underrated about Julia is how the language treats its paradigm. It is an enjoyable language to write because the language itself is never in the way of the arithmetic a programmer might be trying to articulate. Furthermore, Julian code is written quite similarly to the syntax of regular mathematics, making it especially viable for us science nuts.

The biggest hindrance to picking up the Julia language for 2021 is certainly going to be the ecosystem. While being able to write your own algorithms is great, there are only so many hours in a day and sometimes open-source developers have already written great implementations of certain things into other programming languages. That being said, there are some exciting packages worth checking out for the Julia language! Here is an overview of my favorite libraries for both machine-learning and data-visualization, likely two of the most difficult things that a language needs to do for Data Science.

Julia is great because not only is it a fast language to compile, it is also fast to write. While the speed and compilation of Julia might fascinate others, some scientific programmers might be very interested in Julia’s syntax. Julia uses multiple dispatch as a paradigm. This means that anything in Julia from function calls to types and expressions are automatically “ lambdified” using the assertion operator, =. For those who aren’t familiar with the lambda expression in other languages, it allows for variables to be called into a function just by creating an expression. This is what Julia does out of the box, always. If you’d like to learn more about Lambda in Python, I have an article on that, as well!

On top of that awesomeness is the elephant in the room I touched on a moment ago:

Speed.

Of course, Julia is well-known for its speed. Julia uses JIT, or Just In Time, compilation, which allows the language to be compiled at execution. This means that there is firstly less up-time for the compiler to get started, and secondly, types can be handled incredibly dynamically. This can even be iterated upon with different Julia code for even more speed by letting the compiler know what sort of types to prepare for. If you are interested in learning this language, I am right now working on a really cool set of comprehensive software-engineering, Data Science, and general programming tutorials, which you can view the first of here:

Scala

Another interesting programming language that is well-known for its speed is Scala. While Scala used to be the big-data analytics tool for most machine-learning engineers, it has recently been taking a seat further and further away from the front row as newer solutions work it out. That being said, while not understanding Scala or Java might not be as valuable as it was for Data Science ten years ago, knowledge of Hadoop and Spark is certainly great and will translate into knowledge of other server architectures and packages for other languages, such as PySpark.

That being said, while I have used Scala a lot less than expected in my day-to-day work, not all jobs are the same — and Scala is certainly a great programming language to have under your belt. The biggest problems that effect Scala are primarily time, and the lack of modernization for dependencies. A lot of times with Science, dependencies can really become a mess. With languages like Python and Julia, the package managers might be a little too spoiling with their abilities, and sometimes things just aren’t as simple with Scala.

The biggest hindrance to Scala is probably adoption. Scala has slowly but surely become less and less popular. This I think is partially attributed to the rise of analytics, and rapid development of machine-learning ecosystems recently. While Scala might still be used somewhat sparingly for working with big-data, this seems to be very rapidly changing — which is exciting. I wrote an article a while back about how the Julia language could be a potential replacement for Scala that might interest those who like this topic:

C++

The last language that I would consider for Data Science this year is C++. While C++ is often not thought of in the same harmony with Data Science as something like Python, it is a venerable and proven language with over 14 years of development behind it. There are several reasons you might want to use C++, but there are also certainly some reasons not to consider using C++ for Data Science in particular.

The biggest reason for this is because C++ by nature is a relatively imperative language that will require a lot more state and memory management than working with something more declarative, like Python. That being said, for experimentation C++ is probably not the language I would use — as it is statically-typed and could cause some pretty big annoyances when it comes to processing data.

That being said, while C++ might not be the best language to use for experimentation and analysis, there are some compelling libraries in the ecosystem that might draw the attention of any machine-learning engineer. There are several great examples to mention, such as Shogun, MLPack, OpenCV, and all of the typical ports that one might find in the languages on this last like Tensorflow, for example. Furthermore, C++ is naturally a lot faster of a language compared to options like Python and R. This means that algorithms built with C++ code and the C++ ecosystem will often run significantly faster than its competitors.

Believe it or not, C++ is actually quite a popular language in machine-learning. This is especially true with more data pipeline/model-based Data-Science work that might be shared amongst a large team. This is for the same reason that the language is not as good for analysis projects, as often many programmers might be working towards the same goal more frequently together.

The biggest hindrance to the C++ language right now is probably adoption. While C++ does certainly have a whole array of packages one could select something, debugging or solving issues might actually prove to be surprisingly difficult. C++ is easily one of the best languages that you can pick up today in-terms of versatility, but with the naturally more declarative (and mathematical) abilities of other languages, this might not be a great choice for Data Analytics exclusively. This is certainly something that is going to depend on the person, and to be clear — C++ might not want to be the first language for Data Science you could learn.

On the other hand, there are a lot of great advantages to working with the C++ language. There are a lot of great things that the language is capable of that aren’t really found in a lot of other places! If you’d like to get started with C++ ASAP, a great place to start is linear algebra. Luckily, I have written a tutorial on using XTensor, C++’s NumPy equivalent, that you could get started with here:

Conclusion

In the year 2021, Data Scientists are incredibly spoiled for options. While most of the industry has moved to Python, it is fortunate that Python is not the only programming language and/or ecosystem available. R has of course been around a long time as well, and would be another great option in language. Furthermore, the new up-and-coming Julia’s ecosystem and user-base has really boomed over the past year, making Julian ML, stats, and analytics a lot more viable.

Furthermore, there are still hundreds of thousands of different jobs that are desperately searching for Scala, C, and C++ developers — especially with DS/ML skills. That being said, I think that all of these languages are certainly viable choices!

So which of these great languages should you choose to pick-up or do DS/ML with in 2021? The answer of course will almost universally depend on the skills that you need to practice and experience. C++ is probably going to be a lot harder than learning something like Python, R, or even Julia. Scala is also not as easy as some other languages, but those with experience in a Java-based programming language might find the language appealing. Those with no experience at all might also want to start with a querying framework, like SQL.

To conclude, of course there are a lot of really cool languages and tools that we have for Data Science in this year. Hopefully this year is better than 2020, and hopefully any Data Science resolutions made on new years to learn might come true, as well. Who knows, maybe that could be a language on this list? Thank you for reading, and happy New Years!