Programming classes or self-teach? (physics major)

Click For Summary

Discussion Overview

The discussion revolves around the necessity and sufficiency of programming courses for a physics major, particularly whether to take formal classes or self-teach programming skills. It includes considerations of specific programming courses offered in the physics department and the potential benefits of self-learning various programming languages.

Discussion Character

  • Debate/contested, Exploratory, Technical explanation

Main Points Raised

  • One participant expresses uncertainty about the adequacy of physics programming courses compared to traditional computer science classes, questioning if the physics classes would provide sufficient programming knowledge.
  • Another participant suggests that physics majors are generally capable of self-teaching programming, mentioning languages like C++, Fortran, Mathematica, MATLAB, and Python as commonly used in science.
  • A different viewpoint emphasizes the advantages of learning programming in a formal setting, arguing that it helps develop a proper mindset for syntax and debugging, and provides access to resources like professors and peers.
  • Some participants highlight that the second course mentioned (Computational Methods in Theoretical Physics) is the most aligned with real programming, while the third course (Computer Interfacing in Experimental Physics) could be beneficial for experimentalists, though it may not focus heavily on programming.
  • Recommendations for programming languages include C++, MATLAB, and R, with specific book suggestions such as "Thinking in C++" and "The Pragmatic Programmer" for further learning.
  • There is a suggestion that self-teaching can be effective, especially after learning the first programming language, which could be structured and formal.

Areas of Agreement / Disagreement

Participants express mixed views on whether formal programming classes are necessary, with some advocating for self-teaching while others emphasize the benefits of structured learning. No consensus is reached on the sufficiency of the physics courses alone.

Contextual Notes

Participants note that the effectiveness of self-teaching may depend on prior programming knowledge and the specific programming tasks required in physics. There are also mentions of potential computer efficiency requirements that could influence course selection.

Who May Find This Useful

This discussion may be useful for physics majors considering their programming education options, as well as those interested in the intersection of programming and physics applications.

RunSwimSurf
Gold Member
Messages
23
Reaction score
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, Schrödinger 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
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:
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.
 
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.
 
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:
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
 
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..."
 
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
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 21 ·
Replies
21
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 40 ·
2
Replies
40
Views
6K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 14 ·
Replies
14
Views
4K