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

Click For Summary
For beginners interested in programming for physics and astrophysics, C and C++ are highly recommended due to their widespread use in the field. IDL, a commercial language based on Fortran, is also popular in astronomy. The focus should be on learning programming concepts and techniques, as these skills are transferable across different languages. Introductory resources such as "Code Complete" are suggested for understanding programming fundamentals, while "K&R" is recommended for learning C specifically. Overall, the emphasis is on mastering programming skills rather than fixating on a specific language.
theneedtoknow
Messages
169
Reaction score
0
I have never done any programming (except very basic python stuff in 1st/2nd year physics), and I want to 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?
 
Technology news on Phys.org


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.
 


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:


Squeak: Learn Programming with Robots by Stéphane Ducasse
 


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:
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 17 ·
Replies
17
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 56 ·
2
Replies
56
Views
10K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
16
Views
3K