Best programming language for aspiring physics and engineers?

Click For Summary

Discussion Overview

The discussion revolves around the best programming language for aspiring physics and engineering students to learn first. Participants explore various languages, their applications, and the best approaches to learning programming in the context of scientific and engineering fields.

Discussion Character

  • Exploratory
  • Debate/contested
  • Technical explanation

Main Points Raised

  • One participant expresses uncertainty about which programming language to start with, noting that Python is commonly recommended for scientists and engineers.
  • Another participant suggests that learning programming is more effective when it is necessary for a specific task rather than through random examples.
  • A different viewpoint emphasizes the importance of starting early to gain an edge, despite acknowledging the challenges of self-learning.
  • Project Euler is mentioned as a resource for applying programming skills in a practical context once a language is chosen.
  • Several participants propose that C, C++, Java, or Python are suitable starting points, while Fortran is considered more of a specialty language that can be learned later.
  • One participant advises focusing on the details and idioms of the chosen language, as well as on program design principles as one becomes more comfortable with programming.
  • Another participant suggests that after learning C, transitioning to languages like Python or Matlab would be beneficial due to their built-in features for scientific applications.

Areas of Agreement / Disagreement

There is no consensus on a single best programming language to start with, as participants present multiple viewpoints and recommendations. Some emphasize the importance of starting with C or C++, while others advocate for Python or Java, indicating a range of preferences and approaches.

Contextual Notes

Participants note that this question has been asked numerous times in the forum, suggesting a rich history of discussion on the topic. The effectiveness of learning programming may depend on individual circumstances and the specific needs of the learner.

basics
Messages
11
Reaction score
0
I feel that I should start learning how to program. The only thing stopping me from reading a few books and watching some videos is the whole matter of which language to choose from. There are just so many of them. My question is what would be the best and most useful programming language to start learning first. I understand that learning many of them is desired/useful, but I have to start somewhere. So where should I start? I have read that the C languages are the most common, but I think that I read a while ago on this site that (a PF user said:) Python is what most scientists and engineers are using these days. I honestly don't have a clue about this subject. Any input would be met with lots of thanks.

Thank you.
 
Physics news on Phys.org
This particular question has been explored at length before on PF. If you look at the Related Discussions box at the bottom of this page, you will see some related threads.
 
  • Like
Likes   Reactions: 1 person
Don't bother trying to learn programming on your own, it doesn't work. It suddenly you have to do work which requires some programming skill then it will become much easier to learn it then because it is necessary. If you just do random examples from some book you will forget everything the next day.
 
I'm not going to doubt the difficulty level of learning how to program on my own. However, I think that if I want an edge in life, then it would probably be best to get started as soon as possible.
 
Try looking into Project Euler. Once you decide what language to choose, you can use Project Euler to do useful things in it, instead of just "Playing around".

Also, as far as languages go, once you learn one language and learn how to think like a programmer, more often than not learning another one is a lot easier. Like you mentioned, you might want to try C or C++.
 
this has been asked more than a hundred times I am sure, given it has been asked at least 5 times in the last 3 months which given the age of PF it must be over 100. google search with site:physicsforums.com
 
Oh my, you're right. There really does seem to be hundreds of these threads. Well thanks anyway for your help, my friends. And I will definitely look at Project Euler.
 
I've probably made these points in some of those bazillion other "which language" threads, but what the heck, I might as well make them again.

1. Don't stress out over which language you start with. Just pick one and go with it for a while. For a general-purpose language, C++, C, Java or Python are decent choices that come to mind. There are probably some other candidates that I've forgotten about at the moment.

I specifically exclude Fortran because it's more a "specialty" language nowadays, even though a lot of physicists and engineers use it. You can easily pick it up later as a second or third language if you need it.

2. Whatever language you pick, learn its details and idioms well. Input, output, if-statements, loops, subroutines/functions, objects (if it's an object-oriented language), etc.

3. When you get fairly comfortable with the details of your chosen language, start focusing on the overall issues of program design: how to put if-statements and loops together effectively, how to break up a large problem into smaller ones via subroutines or functions, how to lay out your data and pass it back and forth between subroutines and functions. Try different ways of doing the same thing, to get a feel for which ones feel more "elegant" or "understandable" to you.

When you learn a second or third language (or more), you'll obviously have to repeat step 2, but it will probably be easier because many languages share the same general features, just expressing them with different "spelling" (syntax). However, a lot of the work you invest in step 3 will carry over from one language to another.
 
I suggest starting with C or C++. After learning C, you will have no problem picking up new languages as you go. For science and engineering, you will find that a lot of people use Python or Matlab becauseyhey have a lot of built in features that can make life easy. I would pick up either one of those after you've been working with C for a while.
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 1 ·
Replies
1
Views
818
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 26 ·
Replies
26
Views
13K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 71 ·
3
Replies
71
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
12
Views
3K