Hacker News new | past | comments | ask | show | jobs | submit login

Yeah, interestingly, I have this impression that Python is a modern-day Fortran. (Largely for the reasons you describe in the third category of programmers.)



At least among my colleagues (process engineering) the language is basically an afterthought. Your slide rule analogy is right on.

For a lot of the people I work with code is just a way of representing mathematics. So you end up with "Fortran written in every language"

Here is a snippet of code (this is written in C but I guarantee most of my colleagues would write this the same regardless of it it were fortran, python, Matlab what ever).

           for (i=m1;i < m2; i++) 
           {                      //f(p)^2 = (u^T)(Q^T)(D^2)Qu and F(dF/dp) = (u^T)(Q^T)(D^2)Q(du/dp)
               g =h;
               h = (v[i+1]-v[i])/(x[i+1]-x[i]);
               g = h - g - r1[i-1]*r[i-1]-r2[i-2]*r[i-2];
              ...
           }
Here's some SQL

SELECT t2.Line, t2.Slope, t1.X, t1.Y, t1.Y - (t2.Slope * t1.X) as Intercept /* B = Y -Mx */


On some level that's literally true: when you run NumPy or SciPy code, most of your basic array manipulations are done by BLAS, which are a set of very tightly optimized linear algebra routines originally written in Fortran.


A very large part of the answer to "why do people use Python?" is "why did physicists adopt Python en masse in the early 2000s?" and a large part of the answer to _that_ is "f2py exists"...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: