<p>Essentially there is no consensus. To some degree it comes down to personal preference but it also depends on the application - what needs to be done.</p>
<p>Python is a very popular language and for smaller scale scientific usage it is a good language. The main negative concerning Python is it's speed of processing. Its speed of calculation is <strong>slow</strong>. If you have a large data set or need to perform complex calculations, I would not recommend Python. Python is a good language for proof of concept purposes or small tasks. For larger data sets or for complex calculations, a faster language is required. Weather forecast modeling is not done using Python.</p>
<p>In some situations Fortran is still used. Despite its age and most people complaining about its style of programming, it still has applications. Failing that, heavy duty computations are sometimes done using C or C++.</p>
<p>Complied languages tend to be faster than interpreted languages. A newer, scientifically orientated, language which is generating interest is Julia. It's slightly slower than Fortran and C, but <em>much</em> faster than Python.</p>
<p>The R language was initially written as a statistics analysis package, and that is still its forte.</p>
<p><em><a href="https://jonathankinlay.com/2018/10/comparison-programming-languages/" rel="nofollow noreferrer">A Comparison of Programming Languages</a></em></p>
<p><em><a href="https://stackoverflow.com/questions/64300405/speed-in-matlab-vs-julia-vs-fortran">Speed in Matlab vs. Julia vs. Fortran</a></em></p>

CC BY-SA 4.0
2022-05-23T20:13:58.010Z
This is a good condensed answer, but I would add that the major disadvantage of R is its terrible way of handling dependencies - even though some argue it is its strength, it is really a hassle compared to python, nodejs and even java. Weather models are to this day still mainly Fortran, but Julia have some features that makes it interesting in geosciences, namely that you can take the derivatives of the code directly (https://arxiv.org/abs/1607.07892)
Whir
CC BY-SA 4.0
2022-05-23T20:50:03.770Z
Agree with this well.  Weiss you mention models, solid ones are computing intensive... so would think most are in languages like Fortran and C (they certainly used to be).  Whereas simplistic ones I worked on used programs like matlab for ease of work.
JeopardyTempest
CC BY-SA 4.0
2022-05-24T10:29:20.140Z
@JeopardyTempest I strongly recommend NOT to use matlab. You can't do anything serious with parallelization. It costs a fortune that no company with just a little technological sense should be willing to pay with so many open-source alternatives. I know matlab is often used at universities and the new staff we get in that relied on matlab are also the ones with a huge knowledge gap that they need to put a lot of efforts into minimise.
Whir
CC BY-SA 4.0
2022-05-24T16:24:43.463Z
"Python is slow" is, respectfully, a rather superficial take. Python is demonstrably fine for lots of large, computationally intensive tasks. For example, it's used all over the place in computational geophysics and astrophysics on ginormous datasets. Code is faster to write and debug than Fortran or C, and besides the numerical stuff is implemented in Fortran via LAPACK, LINPACK etc, just like it is in MATLAB and of course most Fortran programs. Add Numba, Jax, Dask and all the CuPy stuff, and the speed of native CPython is just a huge non-issue.
Matt Hall
CC BY-SA 4.0
2022-05-24T20:03:07.037Z
@Whir I certainly wasn't suggesting matlab... back 20 years ago the shiny new programs like Mathematica and Matlab were things some of the researchers were dabbling in.  It still goes to show the wider idea that there are many programs people use, and for my major professor back in the day, Matlab was key, and it still has its uses in other fields it sounds like.  But I am a supporter of more open software.
JeopardyTempest
CC BY-SA 4.0
2022-05-23T18:05:18.513Z
2022-05-23T22:50:31.980Z
2022-05-23T22:50:31.980Z
Fred
<p>In my opinion, python is a more established global language that is used by many more disciplines/users, compared to R. This can be advantageous because examples/tutorials are everywhere and you can accomplish many programmatic tasks in one environment. On the other hand, R has a very strong user-base that is specific to data analysis and display.  So, most of the users are in science or math disciplines and know how to get those tasks done well.  Specific to geosciences, python has historically been linked to GIS work, which is an important legacy.  The python packages (e.g. geopandas) handle GIS work very easily and quickly.  But, if you want to get some really nerdy display stuff done with live data, most of my colleagues would recommend R for on-the-fly calculation and display.</p>

CC BY-SA 4.0
2022-05-24T01:40:13.163Z
2022-05-24T01:40:13.163Z
f.thorpe
<p>I was wondering which programming language is most used in the geosciences? I have now started programming with Python but I am reading more and more about R! I would like to ask the experienced scientists which language they use and especially why? I would also like to know if there is a general consensus on this question in the climate and earth science community!</p>

CC BY-SA 4.0
2022-05-24T13:13:46.027Z
I don't think this is a question for Stack Exchange because it's 100% opinion-based. But FWIW, I wrote this on the subject last year > https://agilescientific.com/blog/2021/4/8/which-programming-language-should-you-learn-first
Matt Hall
CC BY-SA 4.0
2022-05-24T13:26:41.473Z
Hi, I Know however it seems there is a lot of discussion potential! I hope it is ok that it stays online cause from this discussions in the answers other early career scientist, like me, can learn a lot from the knowledge of more experienced scientist!
Weiss
CC BY-SA 4.0
2022-05-24T13:33:13.300Z
I agree it's an interesting question, but Stack Exchange [is not a discussion site](https://meta.stackexchange.com/tour).
Matt Hall
CC BY-SA 4.0
2022-05-24T23:12:12.213Z
@kwinkunks I know nothing of earth science, and I even only just joined this community. I just wanted to chip in on this conversation: assume the question was "Python or Assembler, which one should I use?", would you then also say it's opinion based? No, of course not. No one in their right mind would advise Assembler, because Python has a bunch of useful libraries for this kind of stuff. 
A harder, but similar question is Python vs. R. It's a question that can be answered by rational arguments such as easy of use and available libraries. Also: what is the industry standard?
Opifex
CC BY-SA 4.0
2022-06-06T16:09:01.387Z
I find this question not to be opinion based. Remove "commonly" and we have a question that might be hard to answer but has a definitive answer: Which programming language is the most used in geosciences?
Joscha Fregin
CC BY-SA 4.0
2022-06-07T06:43:28.560Z
@J.Fregin thanks for your tipp! I changed it! :)
Weiss
CC BY-SA 4.0
2022-06-08T00:47:57.653Z
I think the intention of this question is valid, but the way it's being asked is too broad and presumptive.  It should mention the range of tasks you want to accomplish programmatically, and offer your observations of programs you've run into (e.g. python and R).   Then ask "Which programming language is most used in the geosciences to accomplish these tasks and why".
f.thorpe
<climate-models><atmosphere-modelling><python><r>
Python, R or etc.?
Weiss
# Python, R or etc.?

(Asked by: username_0 on 2022-05-23)

I was wondering which programming language is most used in the geosciences? I have now started programming with Python but I am reading more and more about R! I would like to ask the experienced scientists which language they use and especially why? I would also like to know if there is a general consensus on this question in the climate and earth science community!

**Tags:** climate-models, atmosphere-modelling, python, r

> **Comments:**
> **username_1**: I don't think this is a question for Stack Exchange because it's 100% opinion-based. But FWIW, I wrote this on the subject last year > https://agilescientific.com/blog/2021/4/8/which-programming-language-should-you-learn-first  
> **username_0**: Hi, I Know however it seems there is a lot of discussion potential! I hope it is ok that it stays online cause from this discussions in the answers other early career scientist, like me, can learn a lot from the knowledge of more experienced scientist!  
> **username_1**: I agree it's an interesting question, but Stack Exchange [is not a discussion site](https://meta.stackexchange.com/tour).  
> **username_2**: @kwinkunks I know nothing of earth science, and I even only just joined this community. I just wanted to chip in on this conversation: assume the question was "Python or Assembler, which one should I use?", would you then also say it's opinion based? No, of course not. No one in their right mind would advise Assembler, because Python has a bunch of useful libraries for this kind of stuff.  A harder, but similar question is Python vs. R. It's a question that can be answered by rational arguments such as easy of use and available libraries. Also: what is the industry standard?  
> **username_3**: I find this question not to be opinion based. Remove "commonly" and we have a question that might be hard to answer but has a definitive answer: Which programming language is the most used in geosciences?  
> **username_0**: @J.username_3 thanks for your tipp! I changed it! :)  
> **username_4**: I think the intention of this question is valid, but the way it's being asked is too broad and presumptive.  It should mention the range of tasks you want to accomplish programmatically, and offer your observations of programs you've run into (e.g. python and R).   Then ask "Which programming language is most used in the geosciences to accomplish these tasks and why".  

---

## 2 answers

### Answer by username_4 on 2022-05-24. Score: 6 | Accepted answer

In my opinion, python is a more established global language that is used by many more disciplines/users, compared to R. This can be advantageous because examples/tutorials are everywhere and you can accomplish many programmatic tasks in one environment. On the other hand, R has a very strong user-base that is specific to data analysis and display. So, most of the users are in science or math disciplines and know how to get those tasks done well. Specific to geosciences, python has historically been linked to GIS work, which is an important legacy. The python packages (e.g. geopandas) handle GIS work very easily and quickly. But, if you want to get some really nerdy display stuff done with live data, most of my colleagues would recommend R for on-the-fly calculation and display.


---

### Answer by username_5 on 2022-05-23. Score: 4

Essentially there is no consensus. To some degree it comes down to personal preference but it also depends on the application - what needs to be done.

Python is a very popular language and for smaller scale scientific usage it is a good language. The main negative concerning Python is it's speed of processing. Its speed of calculation is **slow**. If you have a large data set or need to perform complex calculations, I would not recommend Python. Python is a good language for proof of concept purposes or small tasks. For larger data sets or for complex calculations, a faster language is required. Weather forecast modeling is not done using Python.

In some situations Fortran is still used. Despite its age and most people complaining about its style of programming, it still has applications. Failing that, heavy duty computations are sometimes done using C or C++.

Complied languages tend to be faster than interpreted languages. A newer, scientifically orientated, language which is generating interest is Julia. It's slightly slower than Fortran and C, but *much* faster than Python.

The R language was initially written as a statistics analysis package, and that is still its forte.

*[A Comparison of Programming Languages](https://jonathankinlay.com/2018/10/comparison-programming-languages/)*

*[Speed in Matlab vs. Julia vs. Fortran](https://stackoverflow.com/questions/64300405/speed-in-matlab-vs-julia-vs-fortran)*

> **Comments:**
> **username_6**: This is a good condensed answer, but I would add that the major disadvantage of R is its terrible way of handling dependencies - even though some argue it is its strength, it is really a hassle compared to python, nodejs and even java. Weather models are to this day still mainly Fortran, but Julia have some features that makes it interesting in geosciences, namely that you can take the derivatives of the code directly (https://arxiv.org/abs/1607.07892)  
> **username_7**: Agree with this well.  username_0 you mention models, solid ones are computing intensive... so would think most are in languages like Fortran and C (they certainly used to be).  Whereas simplistic ones I worked on used programs like matlab for ease of work.  
> **username_6**: @username_7 I strongly recommend NOT to use matlab. You can't do anything serious with parallelization. It costs a fortune that no company with just a little technological sense should be willing to pay with so many open-source alternatives. I know matlab is often used at universities and the new staff we get in that relied on matlab are also the ones with a huge knowledge gap that they need to put a lot of efforts into minimise.  
> **username_1**: "Python is slow" is, respectfully, a rather superficial take. Python is demonstrably fine for lots of large, computationally intensive tasks. For example, it's used all over the place in computational geophysics and astrophysics on ginormous datasets. Code is faster to write and debug than Fortran or C, and besides the numerical stuff is implemented in Fortran via LAPACK, LINPACK etc, just like it is in MATLAB and of course most Fortran programs. Add Numba, Jax, Dask and all the CuPy stuff, and the speed of native CPython is just a huge non-issue.  
> **username_7**: @username_6 I certainly wasn't suggesting matlab... back 20 years ago the shiny new programs like Mathematica and Matlab were things some of the researchers were dabbling in.  It still goes to show the wider idea that there are many programs people use, and for my major professor back in the day, Matlab was key, and it still has its uses in other fields it sounds like.  But I am a supporter of more open software.  

---

