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

Basic python stuff in 1st/2nd year physics)

  • #1

Main Question or Discussion Point

I have never done any programming (except very basic python stuff in 1st/2nd year physics), and I wanna learn some a bit more in depth over the summer. Can anyone recommend which programming language I should learn? What's most-widely used for physics/astrophysics?
 

Answers and Replies

  • #2
eri
1,034
20


C or C++ are probably the most widely used, but it varies a lot by specific field. Right now IDL (a commercial programming language, so it's not free, based loosely on Fortran) is popular in astronomy and astrophysics. But the idea is to learn how to program, and then you just need to learn the syntax for a new language. So C, C++, even Perl would be fine for that, and there are a lot of good introductory books out there (and websites) to get you started.
 
  • #3
Cod
324
4


I wouldn't spend much time worrying about which language to use. You need to learn how to program. What I mean by that, is you need to focus specifically on programming techniques and practices since they translate into all languages. There is a great book titled "Code Complete" that covers all sorts of things related to the art of programming while focusing on a few popular languages (C++, C#, and JAVA are the ones I can think of right now). Definitely worth picking up if your interested in programming for hobby or career.

A link to the book: https://www.amazon.com/dp/0735619670/?tag=pfamazon01-20
 
Last edited by a moderator:
  • #4
1,199
25


Squeak: Learn Programming with Robots by Stéphane Ducasse
 
  • #5
HallsofIvy
Science Advisor
Homework Helper
41,794
923
  • #6
5
0


Learn C. All the other languages out there fall into a spectrum with C at one end and Lisp at the other, with most on the C side. You have the intellect to get through 2nd year physics, so work your way through K&R (https://www.amazon.com/dp/0131103628/?tag=pfamazon01-20)
 
Last edited by a moderator:

Related Threads for: Basic python stuff in 1st/2nd year physics)

  • Last Post
Replies
3
Views
3K
Replies
2
Views
2K
  • Last Post
Replies
2
Views
1K
Replies
1
Views
667
Replies
7
Views
980
Replies
10
Views
7K
  • Last Post
Replies
15
Views
11K
  • Last Post
Replies
12
Views
7K
Top