Programming classes or self-teach? (physics major)

In summary, the conversation discusses the necessity of learning programming for a third-year physics major and potential options for learning. The individual is considering taking programming classes in the Computer Engineering/Computer Science department, but also questions if the physics classes they are taking would be enough. They also inquire about self-teaching programming and receive recommendations on which language to learn and books to use. It is suggested that taking a formal programming course for the first language may be beneficial, but self-teaching is also a viable option. The advantages of taking a programming course in addition to learning specific problem-solving methods for physics are also mentioned.
  • #1
RunSwimSurf
Gold Member
23
0
Hello. I am a third year physics major (technically, although I am still taking 200 level classes) and understand that programming is a must. I do not know anything about programming.

I initially planned on taking a summer programming course (if not, then next fall) but it seems as though I'd have to take 2 or 3 classes (due to prerequisites). I do not want to delay graduating. Also, these are programming classes in the Computer Engineering/Computer Science department.

The physics department (upper div) has these:
1. Physics With Symbolic Algebra Software (3)
Learning symbolic algebra programming (e.g. Mathematica) to enhance the problem-solving abilities of students in physics, engineering and mathematics. Interpolation and fitting of experimental data. Sophisticated graphics, animations, analytic calculations, and numerical solutions for a variety of physics problems.

2. Computational Methods in Theoretical Physics (3)
Symbolic (e.g. Maple/Mathematica) and numerical (e.g. Fortran 95/C++) programming, and their applications: e.g. classical mechanical Hamilton equations, quantum mechanical bound and scattering-state problems, Schrodinger equation, Lippmann-Schwinger equation, Dirac equation.

3. Computer Interfacing in Experimental Physics (3)
Modern data acquisition and analysis methods using computer-based equipment and high level software. Physics experiments performed with standard personal computers, research-quality data acquisition hardware, and programmable instruments. Computer use as tool in execution and interpretation of experiments.

My question is: would these physics classes be enough programming or would I need to supplement them with CompSci or CompEng classes? My undergrad advisor suggested I should take a programming class if I was interested, but that it was not truly necessary.

If self-taught programming is a good idea, any recommendations on which language(s) to learn (also any books)?

Thank you for your time.

RSS
 
Physics news on Phys.org
  • #2
I'd say physics majors are well equipped to handle learning programming on their own. C++, fortran, mathematica, matlab, python are used often in science. For C++, the big one, I suggest https://www.amazon.com/dp/0672326973/?tag=pfamazon01-20. It goes through all the basics of computing and programming.
 
Last edited by a moderator:
  • #3
You most likely could self-teach yourself, though I find that it would be best to learn your first language in a formal setting. I find that it would allow you to work on building the proper mindset for syntax, debugging and overall structures of programming. Additionally, if you had problems you'd have an easy resource in your professor or fellow students. After the first language, it's not too difficult to self teach or learn as you go in other languages (especially if you started with a more structured language).

The second course you mentioned is the closest to a real programming course, although the third seems like it could be quite useful if you see yourself as an experimentalist, but it doesn't really specify a focus on actual programming. I wouldn't recommend the first one, though, as programs such as Mathematica (even LaTeX) can be self-taught quite easily if one has had true programming knowledge.

The advantages of taking the second (or third) over simply self-teaching yourself is that in addition to learning programming, you also learn specific methods for solving problems in physics and why certain methods one might initially try won't work accurately. If there's any sort of computer efficiency requirement like there is where I am, it might be simplest to simply take a course in it, thus killing two birds with one stone.

Hope that helped. Keep in mind that this is largely just my experience, and the point that you could learn it on your own is valid, since the process of learning my first programming language (in HS) didn't really hinge on the teacher at all. It is logic and problem solving, after all, which are two things that a physicist needs to be good at anyways.
 
  • #4
RunSwimSurf said:
My question is: would these physics classes be enough programming or would I need to supplement them with CompSci or CompEng classes?

They should be enough.

If self-taught programming is a good idea, any recommendations on which language(s) to learn (also any books)?

C++. If you can handle C++, you can handle anything. You might also want to do something in Matlab or R, since that gets you into a different world.

As far as books. The intro one is Brian Eckel's Thinking in C++. For more advanced stuff get the Pragamatic Programmer and also look at the bibliography...

https://www.pragprog.com/the-pragmatic-programmer/bibliography

Also going to a technical bookstore and just browsing is often quite useful.

Don't let the size of the bibliography scare you. Programming is like other forms of writing. There's always something that you can learn to improve your style.
 
  • #5
Fizex said:
I'd say physics majors are well equipped to handle learning programming on their own. C++, fortran, mathematica, matlab, python are used often in science. For C++, the big one, I suggest https://www.amazon.com/dp/0672326973/?tag=pfamazon01-20. It goes through all the basics of computing and programming.
Thanks! I looked up the book and might pick it up based on the reviews on Amazon and B&N (I have a B&N gift card but I also have a Kindle so I've been looking for an actual book to buy for quite some time).

Cider said:
You most likely could self-teach yourself, though I find that it would be best to learn your first language in a formal setting. I find that it would allow you to work on building the proper mindset for syntax, debugging and overall structures of programming. Additionally, if you had problems you'd have an easy resource in your professor or fellow students. After the first language, it's not too difficult to self teach or learn as you go in other languages (especially if you started with a more structured language).

The second course you mentioned is the closest to a real programming course, although the third seems like it could be quite useful if you see yourself as an experimentalist, but it doesn't really specify a focus on actual programming. I wouldn't recommend the first one, though, as programs such as Mathematica (even LaTeX) can be self-taught quite easily if one has had true programming knowledge.

The advantages of taking the second (or third) over simply self-teaching yourself is that in addition to learning programming, you also learn specific methods for solving problems in physics and why certain methods one might initially try won't work accurately. If there's any sort of computer efficiency requirement like there is where I am, it might be simplest to simply take a course in it, thus killing two birds with one stone.

Hope that helped. Keep in mind that this is largely just my experience, and the point that you could learn it on your own is valid, since the process of learning my first programming language (in HS) didn't really hinge on the teacher at all. It is logic and problem solving, after all, which are two things that a physicist needs to be good at anyways.
Good point, I didn't think about it like that. Thank you for your input. It will definitely help me when it's time to choose classes in upcoming semesters.

twofish-quant said:
C++. If you can handle C++, you can handle anything. You might also want to do something in Matlab or R, since that gets you into a different world.

As far as books. The intro one is Brian Eckel's Thinking in C++. For more advanced stuff get the Pragamatic Programmer and also look at the bibliography...

https://www.pragprog.com/the-pragmatic-programmer/bibliography

Also going to a technical bookstore and just browsing is often quite useful.

Don't let the size of the bibliography scare you. Programming is like other forms of writing. There's always something that you can learn to improve your style.
Wow, that is a long list. A few engineers in my classes recommend learning Matlab. I'll have to look up R, though.
The top review on Amazon (93 out of 93 found useful) for Eckel's "Thinking in C++" recommended reading Konig and Moo's "Accelerated C++" first. I'll have to physically go into the store and skim through these books, I suppose. The reviewer also recommended having some sort of experience (Java or Python) before jumping into C++.

Thank you for all your help.
RSS
 
Last edited by a moderator:
  • #6
Accelerated C++ is a bit advanced, the learning curve is a bit steep..
I am also learning C++ right now..

Walter Savitch's book is quite reccomended, Problem Solving with C++
Despite the name, it's an intro book
 
  • #7
Ashuron said:
Accelerated C++ is a bit advanced, the learning curve is a bit steep..
I am also learning C++ right now..

Walter Savitch's book is quite reccomended, Problem Solving with C++
Despite the name, it's an intro book

What (language) would you recommend to start with?

Edit: nvm, I misread your post. I thought you meant "C++" was a bit advanced. I will check out "Problem Solving with..."
 
  • #8
I am not an expert
I am just repeating some advices I have read in the forums..
Do not start with scripting languages, like Perl or PHP
Just try to study C++ with a decent book..previous knowledge of C is not required

Personally, since I am also a beginner, I feel Thinking in C++ or Accelerated C++ is more like a second book, not really an intro book for people with no coding experience

Previous post mentioned C++ Primer Plus which is well known as a good intro book
 

1. What are the advantages of taking programming classes as a physics major?

Taking programming classes as a physics major can provide you with valuable skills and knowledge that can be applied in your future career. It can also help you understand and analyze complex data and models in your field of study.

2. Is it necessary to have programming skills as a physics major?

While it is not necessary to have programming skills as a physics major, it can greatly benefit you in your studies and career. Many physics research projects and jobs require knowledge of programming languages to analyze data and create simulations.

3. Can I self-teach programming instead of taking classes?

Yes, it is possible to self-teach programming as a physics major. However, it may be more challenging and time-consuming compared to taking classes. It is important to have a strong foundation in programming concepts and practice regularly to become proficient.

4. What programming languages are most useful for a physics major?

The most useful programming languages for a physics major may vary depending on your specific field of study. However, some commonly used languages include Python, MATLAB, and C++. It is important to research and understand which languages are most relevant to your area of interest.

5. Will taking programming classes be too difficult for someone with no prior experience?

Programming classes may be challenging for someone with no prior experience, but many courses are designed for beginners and will start with the basics. With dedication and practice, it is possible to learn programming as a physics major even without prior experience.

Similar threads

  • STEM Academic Advising
Replies
4
Views
858
  • STEM Academic Advising
Replies
6
Views
1K
  • STEM Academic Advising
Replies
9
Views
1K
  • STEM Academic Advising
Replies
16
Views
413
  • STEM Academic Advising
Replies
8
Views
1K
  • STEM Academic Advising
Replies
2
Views
1K
  • STEM Academic Advising
Replies
14
Views
1K
  • STEM Academic Advising
Replies
11
Views
666
Replies
6
Views
962
Back
Top