• Re: Blog: Is Fortran better than Python for teaching the basics ofnumerical linear algebra?

    From FrigidFoxtrot@FrigidFoxtrot@protonmail.com to sci.math,comp.lang.fortran,comp.lang.python on Fri Nov 27 17:09:23 2026
    From Newsgroup: sci.math

    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.
    --- Synchronet 3.21e-Linux NewsLink 1.2
  • From piergiorgio.sartor.this.should.not.be.used@piergiorgio.sartor.this.should.not.be.used@nexgo.REMOVETHIS.de to sci.math,comp.lang.fortran,comp.lang.python on Fri Nov 27 23:42:49 2026
    From Newsgroup: sci.math

    On 06/09/2026 17.29, 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!

    Ah! This reminds me the (now) evergreen:

    "Real Programmers Don't Use PASCAL" (they use Fortran).

    https://en.wikipedia.org/wiki/Real_Programmers_Don't_Use_Pascal https://homepages.inf.ed.ac.uk/rni/papers/realprg.html

    bye,
    --

    piergiorgio
    --- Synchronet 3.21e-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to sci.math,comp.lang.fortran,comp.lang.python on Fri Nov 27 23:29:01 2026
    From Newsgroup: sci.math

    On Fri, 27 Nov 2026 17:09:23 -0500, FrigidFoxtrot wrote:

    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)" ...

    The official convention is to use “@” as the dot-product operator:

    array1 @ array2

    There are ways to define things that look like custom operators, too <https://gitlab.com/ldo/python_topics_notebooks/-/blob/master/Defining%20(Almost)%20Custom%20Operators.ipynb>.
    --- Synchronet 3.21e-Linux NewsLink 1.2
  • From Thomas Koenig@tkoenig@netcologne.de to sci.math,comp.lang.fortran,comp.lang.python on Sat Nov 28 06:58:42 2026
    From Newsgroup: sci.math

    Johann "Myrkraverk" Oskarsson <johann@myrkraverk.invalid> schrieb:

    Best wishes, and happy switching from Python to Fortran 77!

    Starting to use Fortran 77 makes no sense. There are free (as in
    beer) Fortran compilers with more modern versios of the language,
    which is far, far superior in expresiveness and error avoidance.
    --
    This USENET posting was made without artificial intelligence,
    artificial impertinence, artificial arrogance, artificial stupidity,
    artificial flavorings or artificial colorants.
    --- Synchronet 3.21e-Linux NewsLink 1.2