• Support PF! Buy your school textbooks, materials and every day products Here!

Programming classes or self-teach? (physics major)

  • Programs
  • Thread starter RunSwimSurf
  • Start date
  • #1
RunSwimSurf
Gold Member
23
0

Main Question or Discussion Point

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
 

Answers and Replies

  • #2
201
0
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
32
0
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
6,814
12
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
RunSwimSurf
Gold Member
23
0
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).

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.

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
141
0
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
RunSwimSurf
Gold Member
23
0
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
141
0
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
 

Related Threads on Programming classes or self-teach? (physics major)

  • Last Post
Replies
9
Views
6K
  • Last Post
Replies
5
Views
2K
  • Last Post
Replies
3
Views
2K
  • Last Post
2
Replies
35
Views
10K
Replies
0
Views
1K
  • Last Post
Replies
6
Views
1K
  • Last Post
Replies
6
Views
2K
Replies
12
Views
6K
Top