What Coding Language Should I learn?

  • Thread starter Thread starter Jow
  • Start date Start date
  • Tags Tags
    Coding Language
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
11 replies · 3K views
Jow
Messages
69
Reaction score
0
Unlike some of my friends my knowledge of computing is very limited. I want to become a physicist, but I think it would be beneficial for me to learn how to code. However, after some research I am not sure what coding language to learn. What is the most useful / practical code that physicists use?

(I don't know if this will make a difference in what type of code I should learn but the computer I use is a mac.)
 
on Phys.org
C#, FORTRAN, Python, C++, Matlab, Java seem like good choices
 
Whatever you have easy access to... whatever seems like most fun... if your college is running a Java course, do that. If your favourite prof wants you to hack away at his Basic code, learn that...
 
I don't mean to hijack this thread but I am wondering how does knowing how to program help you in physics apart from knowing how to use pre-made simulation programs? What can I do with my C++ CodeBlocks in physics?
 
Gytax said:
I don't mean to hijack this thread but I am wondering how does knowing how to program help you in physics apart from knowing how to use pre-made simulation programs? What can I do with my C++ CodeBlocks in physics?

There are a lot of problems that require numerical techniques to solve. Programming such problems can give insights to how the system behaves; "how does the result change if I change this variable?" You probably won't be able to find code that helps you with a current one, so you may need to make your own. Also, you may need to modify existing code.
 
Gytax said:
I don't mean to hijack this thread but I am wondering how does knowing how to program help you in physics apart from knowing how to use pre-made simulation programs? What can I do with my C++ CodeBlocks in physics?

Anybody who has data from any experiment, ever, has to write a data analysis pipeline to turn that raw data into "scientific results"

EDIT: And most theorists who do simulations write their own simulation code to model the physical system of interest to them. They don't just use other people's code. Or if they do (because it is a generic code for radiative transfer or fluid dynamics or something), they have to modify it to suit their specific application.

I don't know what to do with your question, because almost everyone in the physical sciences needs to be competent at programming for the core aspects of their work.
 
just get a physics leaning computer simulation book and work out the examples.
This one has a bunch of problems and examples.

An Introduction to Computer Simulation Methods: Applications to Physical Systems
 
Gytax said:
I don't mean to hijack this thread but I am wondering how does knowing how to program help you in physics apart from knowing how to use pre-made simulation programs? What can I do with my C++ CodeBlocks in physics?

Simulation programs may not simulate every situation, and if they do they might be too slow. I think the OP should let his particular physics environment drive his career. It maybe he can do experimental physics or theory that doesn't need any programming at all. If you do research under a professor who doesn't require any coding, then you don't need to do any coding (hey tautologies can be useful!) If the research post you get actually appears to need some coding then you can learn on the job.

Then again if you fancy doing some coding, why not... but only if you fancy it... it might be more relaxing to do modern dance between physics classes...
 
These days its hard to do anything in physics without doing some programming/scripting. Many programs that take or analyze data have some programming/scripting component.
 
Mmm_Pasta said:
There are a lot of problems that require numerical techniques to solve. Programming such problems can give insights to how the system behaves; "how does the result change if I change this variable?" You probably won't be able to find code that helps you with a current one, so you may need to make your own. Also, you may need to modify existing code.

That's just sensitivity analysis. That's not specific to programming.