Best programming language for aspiring physics and engineers?

In summary, the conversation discusses the best programming language to start learning and the benefits of learning multiple languages. The suggestion is to start with a general-purpose language such as C, C++, Java, or Python and to focus on learning the details and idioms of the language as well as overall program design. Additionally, it is suggested to pick up other languages such as Python or Matlab after gaining experience with the initial language.
  • #1
basics
11
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
  • #2
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 1 person
  • #3
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.
 
  • #4
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.
 
  • #5
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++.
 
  • #6
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
 
  • #7
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.
 
  • #8
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.
 
  • #9
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.
 

1. What is the best programming language for aspiring physics and engineers?

The best programming language for aspiring physics and engineers would depend on the specific needs and goals of the individual. However, some commonly used languages in the fields of physics and engineering include Python, MATLAB, and C++. Each of these languages has its own strengths and can be used for various purposes.

2. Is it necessary for a physicist or engineer to learn programming?

In today's world, where technology plays a crucial role in research and development in the fields of physics and engineering, knowing how to program can be highly beneficial. It allows for automation, data analysis, and simulation, which are essential aspects of these fields.

3. What are the advantages of learning a programming language for physics and engineering?

Learning a programming language can help physicists and engineers in various ways. It can assist in data analysis, automating repetitive tasks, creating simulations and models, and developing software for specific purposes. It also allows for faster and more efficient problem-solving.

4. Which programming language is best for data analysis in physics and engineering?

Python is often considered the best programming language for data analysis in physics and engineering. It has a wide range of libraries and tools specifically designed for scientific computing and data analysis, making it a popular choice among researchers and professionals.

5. Can I start learning programming if I have no prior experience in physics or engineering?

Yes, programming can be learned by anyone, regardless of their background or prior knowledge in physics or engineering. However, it may be beneficial to have a basic understanding of the concepts in these fields, as it can help with understanding and applying programming concepts in a relevant context.

Similar threads

  • STEM Academic Advising
Replies
12
Views
1K
Replies
16
Views
1K
  • STEM Academic Advising
Replies
3
Views
929
  • STEM Academic Advising
2
Replies
50
Views
4K
  • STEM Academic Advising
Replies
3
Views
407
  • STEM Career Guidance
Replies
22
Views
3K
  • STEM Academic Advising
Replies
16
Views
846
Replies
6
Views
918
  • Programming and Computer Science
Replies
8
Views
867
Back
Top