On 9/6/2026 11:29 AM, Johann "Myrkraverk" Oskarsson wrote:
> Dear comp.lang.fortran, sci.math, and comp.lang.python, > > I came across this blog post about the question which is better to teach > mathematics, Fortran or Python.  I'm currently still reading it, but > will share with you this introductory paragraph. > > > I’ve been teaching an /Intro to Scientific Computing/ class for nearly > > 10+ years. This class is intended for second year engineering students > > and, as such, places a large emphasis on numerical linear algebra. > > Like the rest of Academia, I’m using a combination of Python and numpy > > arrays for this. Yet, after all these years, I start to believe it > > ain’t necessarily the right choice for a first encounter with > > numerical linear algebra. Obvisouly everything is not black and white > > and I’ll try to be nuanced. But, in my opinion, a strongly typed > > language such as Fortran might lead to an overall better learning > > experience. And that’s what it’s all about when you start Uni: > > learning the principles of scientific programming, not the quirks of a > > particular language (unless you’re a CS student, which is a different > > crowd). > > From https://loiseaujc.github.io/posts/blog-title/fortran_vs_python.html > and you are best served by reading the blog post on your own. > > > Best wishes, and happy switching from Python to Fortran 77!
IMO Python is the better language if the students are new to programming. Because it writes a lot closer to how one whiteboards out a program, you don't have as much friction as you would in a Fortran program where you have to declare your variables before using them. It also has type hinting, which provides a very gentle introduction into some fun category theory. Fortran is a lovely language, and for scientific codes that use linear algebra it's still the most logical choice (function calls in Python are expensive as hell, even if you are just calling some compiled library in the background). But if you're just looking to teach linear algebra, it's a lot easier for them to grok if you just say "hey here's this array and this other array. We'll take array1.dot(array2)" because the language abstracts away a lot of the boilerplate. I would put learning Fortran (or anything lower-level than an interpreted language) somewhere after they've learned an abstract language, since it can otherwise be a lot all at once to learn.