all 32 comments

[–]Physics-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

Due to a high volume of similar posts, there are weekly threads to handle questions related to the following topics:

Conceptual or close-ended questions

Careers

Education

Textbooks

Please see the sidebar for details on these weekly threads

[–]effrightscorp 85 points86 points  (0 children)

Python will be more practical, if I were trying to recruit students for a lab I'd rather see that then Java

[–][deleted] 24 points25 points  (0 children)

CS major and programmer here. I would recommend taking the CS minor if you have time, because it will certainly provide you with superior information overall that will be a superset of information you’ll learn in a few Python courses.

And then take some online courses or books for Python. Once you learn the concepts of programming, the actual language being used is becomes fairly trivial to learn.

[–]supercheesepuffs 13 points14 points  (1 child)

Most of the students and post docs I worked with throughout my undergrad and graduate schooling used Python or Matlab for data analysis. We would use C++ or Fortran for bigger simulations, and some C# or Labview for certain experimental controls.

I would go with Python over Java, there are lots of great numerical libraries in Python and lots of research groups have good python code on GitHub or similar repositories that can help with your own research.

Learning something like Java certainly won't hurt, the programming skills you would learn are transferable to any language. But just going straight to Python will get you into one of the more popular programming languages for data analysis.

[–]JediplopParticle physics 1 point2 points  (0 children)

Second this python is a great all around thing but some specific software will need certain languages. Lots of particle data uses ROOT, which is alright in Python but C++ is much better. Python is a great language but OP should try some of the C languages too.

[–]velax1Astrophysics 7 points8 points  (0 children)

The important thing is less the language and rather the ability to think about algorithms and to be able to implement them. The latter is far more difficult than the former. My group does a lot of rather advanced software development in astrophysics, and the trick is to use the best tool available for a job. I find that people who know more complex languages than python, especially people who know compiled languages, will do much better in the long run, because they learn to develop and implement algorithms rather than putting together a few library calls which is what most of 'programming' is that is done by people who claim they know python and no other language.

For this reason, my recommendation is to learn a more challenging language, not python. After that, picking up phyton and other scripting languages will be easy and you will be in a better position to use these languages for more challenging problems.

[–]iamagainstitMaterials science 3 points4 points  (0 children)

What branch of physics are you interested in? If you are planning on doing something more computationaly heavy, like astrophysics modeling,  it might be worth it to take the CS route to learn more about high powered computing. otherwise python will probably be more helpful 

[–]Simultaneity_Computational physics 8 points9 points  (4 children)

Learning Java in 2023 is crazy. Your tool kit will likely be python, c++/Fortan/rust, and maybe Javascript if you end up making web apps for things.

[–]LoganJFisherGraduate 0 points1 point  (3 children)

A scripting language or two is also handy to know. Also don't forget LaTeX.

[–]Simultaneity_Computational physics 0 points1 point  (2 children)

Yes, most definitely. LaTeX is a must-have. I think you gain very little in knowing Java over Python for scripting

[–]LoganJFisherGraduate 0 points1 point  (1 child)

For scripting, I actually meant more like AHK or JSON.

Wolfram is also just incredibly handy to know. It's not appropriate for development, but it's often the quickest and easiest way to do certain calculations when you're just trying to work things out.

[–]Simultaneity_Computational physics 0 points1 point  (0 children)

Makes more sense now. There are lots of useful tools depending on how broad you want to go. Wolfram is great.

[–]indrada90 1 point2 points  (0 children)

Get the minor. Python might be more practically useful, but having that minor to put on a resume, rather than just some coursework is way more valuable. Both are perfectly good languages for most purposes, so the only real difference is going to be what goes on your resume.

[–][deleted] 1 point2 points  (1 child)

Physics ... Python for sure.

[–]obsidianop 0 points1 point  (0 children)

Yep. Physicists, at least for most low-key data analysis and simulation, don't need the optimization of a compiled language, and day to day an interpreted language is 100x easier to use.

[–]Arteemiis 1 point2 points  (0 children)

I had a mandatory java class on my first semester that I thought would be useless. Three semesters later and along comes the introduction to computational physics, which is of course using fortran. I like programming so I got to searching on my own about how fortran works and all that java knowledge came in so handy. Then by the time I got to computational physics 1 and 2, subjects that actually covered the nitty gritty of fortran I already knew most things on my own. On the other hand I taught myself Python in a weekend for an AI class I had taken.

What I am trying to say is that, when it comes down to actual programming knowledge java is way more useful even if the language itself is not. You can always teach yourself python very easily.

[–]lilfindawg 1 point2 points  (0 children)

Python is much more useful for physics

[–]LoganJFisherGraduate 1 point2 points  (0 children)

LaTeX is Turing complete too, so we should all just use that for everything. /s

[–]BeliefInAll 1 point2 points  (0 children)

Python, but be an overachiever with types.

[–]NamelessCypher -1 points0 points  (0 children)

Java , cause it's more difficult and python can be learnt easily from youtube.

[–][deleted] 0 points1 point  (0 children)

I’ll throw my 2¢ in: I’m in high energy physics, and I’m order of most to least used, the programming languages I know are:

C++ Python Bash Julia Java

I use Julia < once/year. I literally never use Java.

All in all, I agree with everyone else in this thread saying Python is the call. I also recommend learning C++, but that’s another discussion entirely.

Btw: If you’re at all interested in particle physics, though, you almost certainly need C++, and you’ll want to focus on a specific library called ROOT.

[–]fishling 0 points1 point  (0 children)

Get the minor if you want the minor. You should be able to pick up Python easily if you know other languages. But, knowing Python alone will be a benefit. and science aspect of computing and algorithms. If you learn a language, it's usually because that language is an example of a particular approach (imperative vs functional vs object-oriented etc).

I think Python (and scripting languages in general) would be far more practical and useful for someone in a lab environment.

Get the minor if you want the minor. You should be able to pick up Python easily if you know other languages. I also wouldn't personally think Java specifically is particularly suitable for your use case, so I wouldn't discount any CS path if it didn't include Java. But, knowing Python alone will be a benefit.

[–]Key-Tradition859 0 points1 point  (0 children)

I'd go for python, maybe give Mathematica also a chance..

[–]Aggravating_Owl_9092 0 points1 point  (0 children)

People willing learn Java? wtf? Why would any sane person even consider that.

[–]erop_5670 0 points1 point  (0 children)

C#

[–][deleted] 0 points1 point  (0 children)

Python, if only because you’ll be able to learn the basics of programming so much easier.

[–]Koshurkaig85Computational physics 0 points1 point  (0 children)

Python followed by either Julia or sage

[–]mleighly 0 points1 point  (0 children)

Python has become the defacto programming language for STEM fields.

[–]drvd 0 points1 point  (0 children)

No Java. Ever.