Qualified data scientists are commanding serious compensation these days. Earning an average base salary of $100,410, data scientists are earning almost 1.5x the 2020 median US household income of $67,521, and that’s before bonus season.
To land a job as a data scientist and gain access to this kind of compensation, you need a strong understanding of statistics, expertise in core data science principles, and, crucially, fluency in at least one of the most popular programming languages for data science — and likely more.
But if you’re just getting started, how do you know which programming language to start with? In this article, we’ll give you the low-down on each of the best programming languages that data science professionals are using every day, including pros and cons and some ways you can get started coding.
What is a Programming Language?
A programming language is a notation system used to write computer programs and direct computers to take particular actions. Some programming languages are general-purpose (Python, Java, C), while domain-specific programming languages (SQL, R, HTML) are used by programmers for specific purposes, like querying databases (SQL), performing statistical analysis (R), or writing web pages (HTML).
How to Approach Data Science Programming Languages
A word on how you should approach your study of programming languages: There are lots of different languages out there, and it’s easy to arrive at the misconception that you should know them all.
In fact, it’s the opposite: to land an entry-level data science job, you should focus your time on going deeper with one or two programming languages instead of trying to achieve rudimentary abilities in many. This will allow you to make a meaningful impact from day one. We’d recommend starting with SQL — you won’t be able to avoid it — and then adding your choice of either Python or R. We’ll go over the arguments for each below.
Top Programming Languages for Data Science
SQL
As we mentioned above, if you want to be a data scientist (or data analyst, machine learning engineer, or even software engineer) there’s no avoiding learning Structured Query Language, or SQL. SQL (usually pronounced “sequel”) is a programming language used to manage data in databases and is “domain-specific,” or usable only in certain applications. These applications include MySQL, Microsoft SQL Server, and Oracle SQL Developer.
With SQL, data scientists are able to store, manipulate, and retrieve data from databases, which can be especially useful in big data situations where Excel would be too unwieldy and inflexible. Because it is easier to learn than other programming languages, SQL is a good place to start for aspiring data scientists.
But SQL isn’t without its limitations. While it works well for structured data that has a predefined format, because it is designed to manage relational databases, it doesn’t have much utility when faced with unstructured raw data where relations between data aren’t defined. And because SQL focuses on data management, it becomes less useful — at least on its own — in situations where a data scientist might want to analyze data, build a web application, or develop a machine learning model.
SQL
| Pros | Cons |
|---|---|
| Easy to learn | Useful only for data management, not data analysis |
| Broad utility | Doesn’t work well for unstructured data |
| Assists management of large, complex databases |
Learning SQL
If you are interested in learning SQL, you have lots of options. Some of the best are:
-
LearnSQL on Codecademy (free with optional upgrade)
-
W3Schools’ SQL tutorial (free) or certification ($95)
-
LearnSQL.com (price varies)
-
Jose Portilla’s SQL Bootcamp ($24.99)
R
After SQL, most aspiring data scientists will learn either R or Python. We’ll go over R first. While SQL is a programming language for database management, the R programming language was instead created to enable statistical computing and graphics. On the R Foundation’s website, they list statistical techniques enabled by R — “linear and nonlinear modeling, classical statistical tests, time-series analysis, classification, clustering” — that can be useful to data analysts and data scientists, especially when it comes time to build machine learning models.
Among its strengths, the R Foundation lists R’s ability to produce publication-ready data visualizations and its large collection of tools for data analytics. It’s also open-source, so it can be run without a fee or license on operating systems like Linux, Windows, and MacOS.
But R also has weaknesses. Specific to statistics, it doesn’t have the wide-ranging utility of a language like Python. R also has a very steep learning curve, with considerable time and effort required to become proficient.
R
| Pros | Cons |
|---|---|
| Open-source and cross-platform | Steep learning curve |
| Supports vast amount of statistical techniques, including machine learning | Limited utility outside of statistics |
| Produces beautiful data visualization |
Learning R
As with SQL, there are lots of options for the aspiring data scientist interested in learning R, including:
-
R for Data Scientists, available on Amazon or for free on the web
-
R Programming Fundamentals from Stanford (free with optional upgrade)
-
Data Science: R Basics from Harvard (free with optional upgrade)
-
W3Schools’ R tutorial (free)
Python
Like R, Python is an open-source language, but while R is a domain-specific programming language, Python is general-purpose, and so learning it will have benefits outside of immediate data science applications. It is also considerably easier to learn than R due to its simple syntax, which is good if you are coming to data science without a computer science background.
Python is also a frequent favorite in the data science community because of its great libraries for data science and machine learning, including Pandas, TensorFlow, and Keras. Data science and machine learning libraries are time-saving essentials for data scientists because they remove the need to start from scratch when approaching a particular data science task. Pandas, for example, provides tools for data manipulation and analysis, while TensorFlow and Keras provide useful frameworks for machine learning.
At the same time, Python lacks the statistical depth of R and is often criticized for being slow, which makes it an inopportune language for tasks like high-frequency trading or game development. Some also don’t believe Python is suitable for industrial application because it lacks scalability due, in part, to how its user-generated libraries are written.
Python
| Pros | Cons |
|---|---|
| Open-source | Slow |
| Easy to learn | Low scalability |
| Extensive data science and machine learning libraries |
Learning Python
If you’re interested in learning Python, great options include:
-
IBM’s Python Basics for Data Science (free with optional upgrade)
-
W3Schools’ Python tutorial (free)
-
Learn Python 2 on Codecademy (free with optional upgrade)
-
LearnPython.org (free)
C
After learning SQL and either R or Python, an aspiring data scientist will already have an impressive programming arsenal to help them land their first job. Eventually, however, most data scientists will learn additional programming languages, with C being one of the most common.
C, developed in the 1970s by Dennis Ritchie, is a general-purpose programming language that has gained widespread adoption for some of the most crucial coding tasks out there, like operating systems. If you’re reading this right now, you have C to thank.
Because C plays such a prominent role in things like computer architectures, data scientists and machine learning engineers will learn it when they are in close contact with software developers and software engineers in enterprise settings. C also has the added benefit of running faster than a language like Python. For those without coding experience, C can be tricky to learn — but because C is so fundamental, doing so will also help you build a much better understanding of how computers work while unlocking additional languages like C# and C++, the latter a frequent favorite of data scientists for its extensive libraries.
C
| Pros | Cons |
|---|---|
| Fast | Potentially difficult for a beginner |
| High scalability | |
| Useful when collaborating with multifunctional teams |
Learning C
If you’re interested in C, some great options are:
-
Learn-c.org (free)
-
Learn C at Codecademy (free)
-
W3Schools’ C tutorial (free)
Java
Java is a general-purpose, cross-platform programming language used frequently by web and software developers. While used less frequently than R or Python for data science, Java is sometimes used as production code once a data science model has been developed in another language because of its speed and scalability. Accordingly, data scientists who know Java can often make a big impact in the production phase, especially if they are employing involved machine learning techniques.
While easy to learn, Java isn’t open-source like SQL or R. To access all features or use commercially, coders need to purchase a license or have their company purchase a license for them.
Java
| Pros | Cons |
|---|---|
| Relative speed and scalability | License required for commercial use |
| Useful for production code | Less direct relevance for data science |
| Easy to learn |
Learning Java
If you’re looking to learn Java, here are some places to start:
-
Learn Java at Codecademy (free)
-
W3Schools’ Java tutorial (free)
-
Learnjavaonline.org (free)
Do Programming Certifications Matter?
When first jumping into data science, it can be tempting to seek out certifications to add prestige on your resume and convince a potential employer you know your stuff. But is a programming certification really a good use of money for an aspiring data scientist? There are so many free resources out there and, accordingly, so many proficient coders out there. Plus it’s unclear that coding certs really carry any weight with employers hiring data scientists. In fact, during a data science interview process, a prospective employer will almost definitely assign some kinds of activity that will allow them to evaluate a candidate’s coding abilities. Put this all together and it suggests that a paid programming certification might not be the best way to go.
When it comes to other kinds of certifications, we see things differently. In our articles on data analyst and data science certifications, for example, we’ve compiled some opportunities we think might be worth your while.
Where Else Can You Learn Programming Languages for Data Science?
We’ve covered the most popular data science programming languages and suggested how you might go about learning them — but it’s worth noting that if you enter a data science bootcamp or bachelor’s degree program, you will assuredly have an opportunity to learn to code as you study. Of course, this doesn’t mean you should eschew the great options we’ve listed above — they can be great prep in the weeks or months before your course of study starts.
If you’re interested in learning more about data science degree programs, check out the guide that is most relevant to your situation:
Or, if you want to see how far data science programming languages can get you, dive deeper with our article on the typical data science career path. There, we’ll give you an idea of what you’ll need to know, what kind of impact you’ll have, and how much you’ll earn at each step along the way.