Most Common Programming Language in Physics Career

Click For Summary

Discussion Overview

The discussion revolves around the most common programming languages applicable in physics careers, exploring the preferences for different languages in various subfields such as research and simulation/modeling. Participants share insights on the relevance of specific languages and their applications in different job roles within the physics domain.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Exploratory

Main Points Raised

  • Some participants suggest that Matlab is widely used for data analysis tasks, while others mention the use of Fortran and C++ for modeling.
  • Python is highlighted as a popular alternative, especially among those who prefer not to pay for Matlab subscriptions, with some advocating for its use in conjunction with Jupyter notebooks.
  • Julia is noted as an emerging language in physics, though its adoption faces challenges due to the established use of Matlab.
  • There is a consensus that the choice of programming language heavily depends on the specific subfield within physics, with no one-size-fits-all answer.
  • Some participants emphasize the importance of learning programming concepts over focusing solely on specific languages, arguing that understanding the underlying principles is crucial.
  • Discussions about the readability and efficiency of different languages arise, with some arguing that Python, while slower than C, is more readable and requires fewer lines of code.
  • Participants engage in a side discussion about the grammatical distinctions between "less" and "fewer," with some emphasizing the importance of understanding variable types in programming.

Areas of Agreement / Disagreement

Participants generally agree that there is no single best programming language for physics careers, and multiple competing views remain regarding the most suitable languages for different contexts and applications.

Contextual Notes

The discussion reflects varying opinions on the relevance of specific programming languages based on job roles and subfields, highlighting the complexity of language choice in relation to project requirements and personal experience.

Sheikhzaadi
Messages
10
Reaction score
4
HELLO ALL,

First off, my apologies if this topic is redundant, but I was wondering which programming language is widely applicable to a physics career. What positions in a Physics related career use what specific languages? What is one's best option if one is pursuing a research position versus someone who is looking at a simulation/modeling-specific job?Thank you for your time in advance.
 
Physics news on Phys.org
it depends. Where I worked it was Matlab with some folks using and tweaking Fortran modeling code or C++ modeling code but primarily Matlab for data analysis tasks. There were other groups who didn't like the high cost of Matlab subscriptions and decided on using Python with Jupyter notebooks for their work (ala the Anaconda Python distro)

Julia is now making strides into physics work too but they are fighting against a formidable foe in Matlab and its hard to get folks to change their habits and coding workflows.

Checkout some job descriptions of places where you'd like to work and see what they are looking for.

Personally, I think you should focus on Matlab and/or Python both good for data analysis and machine learning tasks followed by Fortran and C++ for certain modeling and lastly Julia for the future.
 
  • Like
Likes   Reactions: Astronuc, DeBangis21, Math100 and 2 others
It depends completely on what subfield we are discussing. I don’t think it would be healthy to generalize.
 
For someone doing research work, sorting and analyzing data
Orodruin said:
It depends completely on what subfield we are discussing. I don’t think it would be healthy to generalize.
Say someone doing research work, sorting and analyzing data geared toward their research. What language would be best?
 
Sheikhzaadi said:
Say someone doing research work, sorting and analyzing data geared toward their research. What language would be best?
What programming languages have you used so far? What kinds of programming projects have you done so far?
 
I have always felt that it is better to learn how to program rather than being able to cobble something together in one particular language.
 
  • Like
Likes   Reactions: Astronuc
There’s no best programming language. Programmers choose or use the language that best fits the project. If you are working on a web project and much of it is in Java then you use Java. If it’s a machine learning project and most work is in Julia then you use Julia. if it’s python project then you use python.

you need to worry about compatibility issues and using the same project language eliminates these kinds of issues.

When I write tool scripts for project maintenance I’ll use python. While slower than using C its arguably more readable and likely less lines of code.
 
jedishrfu said:
There’s no best programming language.
FORTRAN!
 
  • Haha
Likes   Reactions: jedishrfu
jedishrfu said:
While slower than using C its arguably more readable
<cough, cough>

jedishrfu said:
likely less lines of code
Fewer lines. "less" is a float, "fewer" is an int. <evil grin>

Stupid grammar niggles and jumping on you for a typo aside, there is more value in understanding the difference between an integer and a floating point number than knowing whether it's an INTEGER, an int, a short, an i16, etc. Understanding concepts is more important than just understanding syntax.
 
  • #10
berkeman said:
What programming languages have you used so far? What kinds of programming projects have you done so far?
I haven't done any projects. I have some experience with C ++ and am self-learning python. Just trying to gain some edge to land a physics career-related job.
 
  • Like
Likes   Reactions: jedishrfu
  • #11
In FORTRAN using implicit rules fewer would be a REAL and less would be an INTEGER ie variables starting with the letter I thru N are implicitly INTEGER unless explicitly defined otherwise and variables starting with any letter other than I thru N would be considered REAL.
 
  • Like
  • Haha
Likes   Reactions: hutchphd and Vanadium 50
  • #12
After learning the language, you to branch out and find uses for your skill. You could consider writing different types of games or doing some numerical simulations. Things that would get you to explore third party libraries commonly used with the language.

Some python devs use Anaconda Python which ships with Numpy, Scipy, Pandas and other cool libraries. Anaconda provides the means to do data analysis, machine learning and numerical simulations with these libraries.

when you get to that level, you can feel confident that you understand the language.
 
  • Like
Likes   Reactions: DeBangis21
  • #13
Sheikhzaadi said:
Just trying to gain some edge to land a physics career-related job.
The problem is that if you spend a little time at it, you will only gain a little edge.

If you want a serious edge, you need to program noticeably better than your peers. That doesn't happen overnight, and learning the syntax of one language won't quite do it.
 
  • #14
jedishrfu said:
In FORTRAN using implicit rules fewer would be a REAL and less would be an INTEGER ie variables starting with the letter I thru N are implicitly INTEGER
The above isn't relevant to V50's niggle about the grammatical use of fewer vs. less, which is the difference between discrete amounts vs. continuous amounts. E.g., the difference between "less sugar and fewer calories." It wasn't about the somewhat arbitrary division of alphabetic letters used for the first letters of Fortran variables.
 
  • #15
Mark44 said:
The above isn't relevant to V50's niggle about the grammatical use of fewer vs. less, which is the difference between discrete amounts vs. continuous amounts. E.g., the difference between "less sugar and fewer calories." It wasn't about the somewhat arbitrary division of alphabetic letters used for the first letters of Fortran variables.

My apologies. I didn't understand @Vanadium 50 ‘s comment. As I reread it, I can see I was sloppy with my English use of less. English was never my strong point in school.

In the context of programming, we often use the less than operator with integer values so one argue while its a poor choice, the meaning is understandable here.
 
Last edited:
  • #16
Mark44 said:
less sugar and fewer calories
I'd argue calories are discrete too. "Fewer raisins" would be something I would call discrete. (The line can be blurry - "half a bottle of beer".)

My real point, not just the fun-poking, is that it is more important to understand variable typing than how any particular language does it. We have a whole thread going on right now in another section because people don't understand how floating point variables work.
 
  • #17
I didn't see that thread did I?

But yes floating point can be obscured by folks using integers in a fixed point manner making it even more confusing as in keeping money values in pennies and dividing by 100 for dollars.
 
  • #18
jedishrfu said:
In the context of programming, we often use the less than operator with integer values
... because there is no "fewer than" operator.
 
  • #19
Vanadium 50 said:
I'd argue calories are discrete too.
Calories (in the context of food) are almost always given in integral values, so "fewer" is appropriate while "less" is not. Recall the old ad (for some brand of beer, I think) -- "Blatz Lite has less calories."
 
  • #20
Mark44 said:
"Blatz Lite has less calories."
Looks like there is mix of use when it comes to beer... LOL

1669665396036.png
 
  • #22
To my ear only "fewer" works for the enumerable and only "less" works for continuous stuff.
But "more" works for either! Is this so? Seems strange..
 
  • #23
Yeah, but some dictionaries say you can use "infer" and "imply" interchangably too. (inside Mentor joke)

But, @hutchphd that's how it goes in most cases. Less emphasizes quantity, and fewer emphasizes number. It is similar to int and float in C or Integer and Real in Pascal. There are some rare exceptions - long or long long ints sometimes take less.

One are where clarity is usually needed and often missing is the difference between an enum and an integer. Part of the reason is that lots oflanguages don't have good enums, and part pf the reason is that integers usually do everything an enum can do and more. But you really don't want that: x = Sunday*Thursday - Monday should throw an error. If someone codes that, they probably didn't mean it.

This is why I think it's important to learn how to program, rather than only being able to cobble something together in one's favorite language. It helps one spot errors and things that were unintended. As I said on the other thread, the plausible but wrong answer is dangerous.
 
  • Like
Likes   Reactions: Mark44 and hutchphd
  • #24
Mark44 said:
Calories (in the context of food) are almost always given in integral values, so "fewer" is appropriate while "less" is not. Recall the old ad (for some brand of beer, I think) -- "Blatz Lite has less calories."
That’s the difference between advertising and science, right there. Anyhow, not to put too fine a point on the whole business, both fewer than and less than are Boolean valued operators which any sensible language design should both be applicable to floats, into, scalars, or cardinals, accommodating mixed operand types where possible.Your fave language may vary, too bad.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 62 ·
3
Replies
62
Views
10K
Replies
5
Views
4K
  • · Replies 18 ·
Replies
18
Views
6K
  • · Replies 10 ·
Replies
10
Views
4K