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

  • Context: Python 
  • Thread starter Thread starter theneedtoknow
  • Start date Start date
  • Tags Tags
    Physics Python Year
Click For Summary

Discussion Overview

The discussion centers around recommendations for programming languages suitable for someone with basic Python experience, particularly in the context of physics and astrophysics. Participants explore various languages and emphasize the importance of programming techniques over specific language syntax.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant suggests that C or C++ are widely used in physics and astrophysics, but notes that usage varies by specific field.
  • Another participant mentions IDL as a popular language in astronomy and astrophysics, highlighting its commercial nature and Fortran roots.
  • Some participants emphasize the importance of learning programming techniques that are applicable across different languages rather than focusing solely on which language to choose.
  • A recommendation is made for the book "Code Complete," which covers programming practices relevant to multiple languages.
  • Another participant suggests learning C, stating that many languages fall on a spectrum with C at one end, implying its foundational importance.
  • Additional resources, such as a Java environment and a specific book on C programming, are provided by participants.

Areas of Agreement / Disagreement

Participants generally agree on the importance of learning programming techniques and practices, but there is no consensus on which specific programming language is the best to learn for physics or astrophysics.

Contextual Notes

Some limitations include the lack of clarity on how different fields within physics may prioritize different programming languages, and the discussion does not resolve which language might be the most beneficial for the original poster's goals.

Who May Find This Useful

Individuals interested in learning programming for applications in physics or astrophysics, particularly those with minimal prior experience.

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:

Similar threads

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