Preparing for Physics: Choosing the Right Language to Learn

  • Thread starter Thread starter Invyz
  • Start date Start date
  • Tags Tags
    Language Physics
Click For Summary

Discussion Overview

The discussion revolves around the selection of programming languages beneficial for students planning to major in physics. Participants explore various language paradigms, their applications in scientific computing, and the relevance of learning multiple languages to enhance programming skills in the context of physics.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant suggests learning a functional language such as Standard ML, OCaml, F#, Haskell, or Scheme.
  • Another participant emphasizes the importance of learning a low-level language like C to understand underlying processes.
  • A participant mentions using C++ for calculations and simulations, noting its accessibility and availability.
  • There is a question about the differences between C and C++, with some participants asserting that C++ builds upon C with object-oriented features.
  • One participant proposes OCaml or F# as suitable choices for physicists, depending on the operating system.
  • Discussion includes the relevance of Fortran and Python in scientific computing, with a suggestion to check departmental preferences at universities.
  • Some participants express differing views on the necessity of learning C for understanding other programming languages, particularly functional languages.
  • There is a debate about the effectiveness of object-oriented programming and the foundational benefits of learning C for programming in C-derived languages.

Areas of Agreement / Disagreement

Participants express a variety of opinions on the best languages to learn, with no clear consensus on a single approach. Disagreements arise regarding the importance of learning C in relation to other programming paradigms and the effectiveness of object-oriented programming.

Contextual Notes

Some participants note that understanding different programming paradigms is essential, but there are unresolved questions about the best foundational languages and their applicability to various programming tasks in physics.

Invyz
Messages
14
Reaction score
0
I was wondering which language would be most beneficial to study if I plan to major in physics in college and would like a head start? I have a basic BASIC knowledge of java, and generally understand syntax, methods, etc.
 
Technology news on Phys.org
I would suggest learning a functional language like Standard ML, OCaml, F#, Haskell or Scheme.

Also, it helps to learn at least one low-level language like C so you know what goes on 'under the hood'.
 
I use C++ for all of my calculations/simulations. It is not too hard to learn and you can download it for free from Microsoft.

Thanks
Matt
 
DavidSnider said:
I would suggest learning a functional language like Standard ML, OCaml, F#, Haskell or Scheme.
C++ or C? Or isn't there a huge difference.

Also which out of those 5? That's a lot of choices.
 
For a physicist I would probably go with OCaml or F#. OCaml for linux and F# for windows.
 
CFDFEAGURU said:
It is not too hard to learn and you can download it for free from Microsoft.
Or use a basic compiler like mingw and not bother with visual studio madness.

Besides C/C++, there's still some scientific computing done in fortran. For upper level stuff, I've seen a lot of scientific computing libraries in python, and MATLAB is very commonly used in the science community. If you already know where you're going, try to find out what the department at your school commonly uses.

C++ or C? Or isn't there a huge difference
Yes, no, maybe. C++ is basically C with objects, so to code C++ well it's good to know the basics of C. (Generally, if you know C, you'll get all the other languages.)
 
Invyz said:
DavidSnider said:
I would suggest learning a functional language like Standard ML, OCaml, F#, Haskell or Scheme..
C++ or C? Or isn't there a huge difference.
None of those languages is C or C++. C is a procedural language. C++ adds object-oriented concepts to C. Java similarly is a procedural language that supports object-oriented concepts.

Procedural and functional paradigms are quite different -- and that is precisely why it is a good idea to learn both paradigms.


story645 said:
Yes, no, maybe. C++ is basically C with objects, so to code C++ well it's good to know the basics of C. (Generally, if you know C, you'll get all the other languages.)
I disagree with that parenthetical remark. There are plenty of C plus-or-minus programmers who are writing things in what looks like C++ but do so from a solidly C-based mindset. Do object-oriented programming right and your mindset changes considerably. Learning C won't help much at all in learning a functional language such as Lisp or a logical language such as Prolog.
 
D H said:
Do object-oriented programming right and your mindset changes considerably. Learning C won't help much at all in learning a functional language such as Lisp or a logical language such as Prolog.
If he knows java well, he should know how to do object-oriented coding. C++ isn't all that great either because of how classes are implemented. Knowing C helps with the basics, (like control structure), but truthfully yeah I misspoke.
What I meant was C's a good base for all the C derivative languages ('cause the C stuff shows up in all of them) and is barebones enough to teach a lot of good stuff about the basics and optimization. You need all those before moving on to different paradigms, where yes one of each to figure out how it all works.
 

Similar threads

Replies
86
Views
3K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 25 ·
Replies
25
Views
1K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
16
Views
4K
  • · Replies 7 ·
Replies
7
Views
2K