🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.python
2 messages
2 total messages Started by FrigidFoxtrot Fri, 27 Nov 2026 22:09
Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?
#309
Author: FrigidFoxtrot
Date: Fri, 27 Nov 2026 22:09
45 lines
3848 bytes
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.
Re: Blog: Is Fortran better than Python for teaching the basics of numerical linear algebra?
#311
Author: Lawrence D’Oliveiro
Date: Fri, 27 Nov 2026 23:29
12 lines
1809 bytes
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>.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads