Should I enroll in a python course or java? (I’m studying physics)

  • #1
Python based course or java course ?. I will be taking an introductory computer programming course . One is python based and the other is java based. The java based course has 2 semesters and goes more in depth with programming . Would it be useful to just take the java courses and get the stronger programming background , or take python course ? I have been exposed to python a little bit but I have no formal training in programming and writing code to solve .problems. A physics professor did recommend the java course and noted that it’s better to gain programming knowledge and skills and not worry much about what language to learn as those can be learned when needed if I already have programming skills .
 

Answers and Replies

  • #2
Vanadium 50
Staff Emeritus
Science Advisor
Education Advisor
2019 Award
25,119
8,233
A physics professor did recommend the java course and noted that it’s better to gain programming knowledge and skills and not worry much about what language to learn as those can be learned when needed if I already have programming skills .
And why do you not want to take this advice?
 
  • #3
And why do you not want to take this advice?
Just like to hear other perspectives before I make decisions. I’ve been given a lot of bad advice over the years .
 
  • #4
Math_QED
Science Advisor
Homework Helper
2019 Award
1,692
718
Python is easier, but for the rest that professor gave good advice.
 
  • #5
Ibix
Science Advisor
Insights Author
6,829
5,675
On careful reflection, I'd say do one or the other.

It's true that once you've learned to program in one language, picking up another is fairly straightforward. In the long run, your professor's advice is good. However, all languages have their foibles and ways of working, and there's a learning curve in doing things without fighting the language.

So if you know you'll be using python in anger in the near future I'd recommend the python course. If you don't know that, I'd recommend Java. You can always download python and play around with it in your spare time.
 
  • #6
Dr. Courtney
Education Advisor
Insights Author
Gold Member
3,242
2,381
In the end, you'll need to learn several programming languages on your own.

When you join most research groups early in your career, you'll have to learn whatever language they are learning.

Often it's C, C++, or Fortran.

Your choice now is just a choice on what may be a better launch pad for what comes next.

Stop doodling and get to work.
 
  • Like
Likes Mondayman
  • #7
wle
316
139
Python based course or java course ?. I will be taking an introductory computer programming course . One is python based and the other is java based. The java based course has 2 semesters and goes more in depth with programming . Would it be useful to just take the java courses and get the stronger programming background , or take python course ? I have been exposed to python a little bit but I have no formal training in programming and writing code to solve .problems. A physics professor did recommend the java course and noted that it’s better to gain programming knowledge and skills and not worry much about what language to learn as those can be learned when needed if I already have programming skills .
I'd go with Python, personally. You are much more likely to use it. Java is one of the most important programming languages in the corporate world but as far as I know there's hardly anyone using it in physics, while there are quite a lot of people using Python.

Other responders here have pointed out that it doesn't matter too much which programming language you learn first since you'll likely have to learn more than one in the longer term anyway. This is true. But it is also true that not all programming languages are equal and you might as well start with the one that you're likely to get the most out of. I learned some Java when I was a teenager (it was one of the first languages I learned) and, personally, I now find it very bureaucratic and inflexible compared with other languages I've learned and used since then, including Python. I can't imagine any situation where I would pick Java as the language I wanted to use, especially for anything relating to physics research.
 
  • Like
Likes Phys12
  • #8
Vanadium 50
Staff Emeritus
Science Advisor
Education Advisor
2019 Award
25,119
8,233
I disagree with wle and agree with your professor. Sure, there's a lot of Python out there, and there's a lot of terrible Python out there. It is more important to learn how to program.
 
  • #9
1,487
1,333
Python based course or java course?
Definitely Java if you want to learn programming. You might have to learn Python later on by yourself if you want to stick to Science, but for a beginner, Java is the way to start. In our Python classes in college, many of my friends were completely new to programming, and they found it difficult to understand Python concepts. I felt they would have done a lot better if they started with Java first. Java will help you gain experience in programming.

In Python, the problem every student faces is indentation. Java doesn't have any such problem, so it's easier to grasp the concepts. Once you have an experience in programming, you can easily grasp any language.
A physics professor did recommend the java course and noted that it’s better to gain programming knowledge and skills and not worry much about what language to learn as those can be learned when needed if I already have programming skills.
Follow his advice.
 
  • Like
Likes Dr Transport
  • #10
1,632
882
As others have observed, Python is easier to get started with, but Java is more in-depth -- this article makes good arguments for preferring Java over Python as a beginning programming language, and includes this humorous image:

1590393606110.png


I suggest that you browse http://rosettacode.org and compare the Python solutions with the Java solutions.
 

Related Threads on Should I enroll in a python course or java? (I’m studying physics)

Replies
2
Views
672
Replies
4
Views
2K
Replies
1
Views
548
  • Last Post
Replies
4
Views
2K
Replies
4
Views
3K
  • Poll
  • Last Post
Replies
10
Views
9K
Top