Fortran Fortran tutorial for someone with no prior programming experience?

AI Thread Summary
Fortran is recommended as a suitable first programming language for someone pursuing physics due to its legacy libraries and static typing, which aids in understanding variable declaration. While tutorials for Fortran often assume prior programming knowledge, several resources are available for beginners. Python is also suggested for its popularity in scientific computing and ease of use, making it a valuable second language. Many professionals use both languages together, leveraging Fortran for calculations and Python for data manipulation and visualization. Ultimately, learning both Fortran and Python can provide a strong foundation for programming in physics.
Light Bearer
Messages
23
Reaction score
0
Hi there,

As the title suggests, I am looking to start learning my first programming language. I am a mature student (24) who has recently returned to school to pursue physics. A friend of mine who does physics suggested that I learn Fortran (90/95) as my first language. I am looking online for tutorials but haven't had much luck. The tutorials on the Fortran site all seem to assume prior programming experience, and obviously I have none :frown: I was hoping someone could recommend a good online tutorial (preferably free, but I am willing to pay)...Any help is appreciated.

Alternatively a good friend of mine who does CS suggested that I learn Python as my first language and provided me with a great online tutorial. Opinions on whether I should learn Fortran or Python as my first language? Or is it irrelevant? Thanks!
 
Technology news on Phys.org
I'd check out Processing.org as a first language. Its designed from visual graphic artists uses Java syntax and gives immediate feedback. Processing is based on Java so learning it isn't a loss. From there I'd get into using Java and learn how to use Netbeans or Eclipse for serious programming.

For physics related stuff I'd checkout Open Source Physics at www.compadre.org/osp. They have a lot of physics simulations. I took a course a few years ago where we used the book Intro to Comp Physics which is based on the Open Source Physics library and can do a lot of cool simulations.

Other opinions will follow...
 
Last edited:
If your interests are in physics, then, yes, Fortran and Python are very good choices. Fortran for all the legacy libraries that by virtue of being around for decades are now bug-free. And Python for its great popularity in the engineering and scientific community as a quick dynamic language, as a replacement for MATLAB and mathcad in both programming ease, handling of matrices, and data visualization.

If you have to choose, I would learn Fortran first. Up to Fortran 77, it all was very easy to learn; starting from Fortran 90, Fortran started to include more advanced stuff that makes learning Fortran a bit more of an effort.

I can think of two reasons to learn Fortran first:
  1. Its staticly-typed nature...you will learn to declare variables correctly of a type and keep them that way.
  2. For the purposes of programming physics or other calculations/simulation, you can quickly learn most of Fortran, if not all, in a short given time frame with a tutorial or a book and be done with it.
I can think of a reason to take on Python second:
  1. You may never finish studying Python...and all its modules; thus, you would probably never get back to Fortran

Often, you need both. People continue to use individual Fortran functions for the main number crunching and glue them together by wrapping them with Python to ease GUI creation, data gathering and manipulation, data visualization.

my 2 cents...more like 3
 
Thanks for all the replies, I appreciate it. I've downloaded all the recommended tutorials and look forward to getting into them. I will learn Fortran first...thanks gsal!

rcgldr said:
A somewhat current primer for Fortran:

fprimer.pdf
I go to SMU! I had no idea this existed. I guess I will start learning Fortran from Clarke's tutorial and see how it goes.

Thanks again :biggrin:

Edit: The Python tutorial my friend recommended: http://learnpythonthehardway.org/book/
 
Last edited:
gsal said:
If your interests are in physics, then, yes, Fortran and Python are very good choices. Fortran for all the legacy libraries that by virtue of being around for decades are now bug-free. And Python for its great popularity in the engineering and scientific community as a quick dynamic language, as a replacement for MATLAB and mathcad in both programming ease, handling of matrices, and data visualization.

If you have to choose, I would learn Fortran first. Up to Fortran 77, it all was very easy to learn; starting from Fortran 90, Fortran started to include more advanced stuff that makes learning Fortran a bit more of an effort.

I can think of two reasons to learn Fortran first:
  1. Its staticly-typed nature...you will learn to declare variables correctly of a type and keep them that way.
  2. For the purposes of programming physics or other calculations/simulation, you can quickly learn most of Fortran, if not all, in a short given time frame with a tutorial or a book and be done with it.
I can think of a reason to take on Python second:
  1. You may never finish studying Python...and all its modules; thus, you would probably never get back to Fortran

Often, you need both. People continue to use individual Fortran functions for the main number crunching and glue them together by wrapping them with Python to ease GUI creation, data gathering and manipulation, data visualization.

my 2 cents...more like 3
Good advice!
 
I may as well just learn them both.
 

Similar threads

Back
Top