Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Should Undergraduates Be Taught Fortran?

CmdrTaco posted more than 5 years ago | from the or-spend-it-building-forts dept.

Programming 794

Mike Croucher writes "Despite the fact that it is over 40 years old, Fortran is still taught at many Universities to students of Physics, Chemistry, Engineering and more as their first ever formal introduction to programming. According to this article that shouldn't be happening anymore, since there are much better alternatives, such as Python, that would serve a physical science undergraduate much better. There may come a time in some researchers' lives where they need Fortran, but this time isn't in 'programming for chemists 101.' What do people in the Slashdot community think?"

Sorry! There are no comments related to the filter you selected.

It's okay to teach them FORTRAN (5, Funny)

sharkette66 (256044) | more than 5 years ago | (#28291847)

But only if they have to do it on punch cards, like I did. Give each student a can of WD40 to keep the machines working smoothly, too.

WD40? (1)

Finallyjoined!!! (1158431) | more than 5 years ago | (#28291913)

Nah, give them a can of AC90. Encourage diversity..

Not punched cards (1)

davebarnes (158106) | more than 5 years ago | (#28291953)

I love Fortran (or FORTRAN as we old folks spell it).
But, no one should be forced to use an IBM 026 Keypunch (

Oh come on. (5, Funny)

geminidomino (614729) | more than 5 years ago | (#28291849)

--No one-- should be taught FORTRAN. Ever...

*sobs in fetal position*

Re:Oh come on. (4, Insightful)

Opportunist (166417) | more than 5 years ago | (#28292009)

Right. Teach COBOL instead!

Job security well into the next millenium!

Re:Oh come on. (1)

Warlord88 (1065794) | more than 5 years ago | (#28292031)

I agree. There are so many better first languages. I was fortunate to learn C++. Python seems to be growing in popularity as first language that can be learned. OK. TFA mentions that.

Re:Oh come on. (5, Insightful)

joss (1346) | more than 5 years ago | (#28292299)

God forbid, don't teach em python first. Learn assembly, c++, ML, fortran even fucking visual basic. You can't learn python first, it's like eating the pudding before the salad. Python is the *last* language you should learn.

Yes, I'm serious.

Re:Oh come on. (5, Funny)

scubamage (727538) | more than 5 years ago | (#28292095)

Yep, real men use ADA.

...And drink very heavily.

Re:Oh come on. (4, Interesting)

mabhatter654 (561290) | more than 5 years ago | (#28292215)

but for math geeks FORTRAN is probably the easiest language to get from pencil-n-paper to computer. Math functions in FORTRAN translate nicely from their paper counter parts. If you can do math and "show your work", or punch numbers in a calculator, you're 2/3 of the way to a FORTRAN command line program.

I don't think it's a useful first language anymore. Something like Python would be more useful "out of college". FORTRAN is really easy to pick up later anyway as it's "old fashioned" and line numbered based. I'd think the biggest problem teaching the class now would be getting students to take it seriously because it's a much older way of thinking about programs from our modern OOP languages.

YES... (0)

Anonymous Coward | more than 5 years ago | (#28291853)

I had to learn it. Everyone else should have to go through that hell!

How would you learn? (3, Interesting)

CRCulver (715279) | more than 5 years ago | (#28291855)

Are there any cheap but quality tutorial for Fortran? O'Reilly has no contemporary introduction to the language and their last book on Fortran, Migrating to Fortran 90 [] , came out nearly two decades ago.

Re:How would you learn? (4, Informative)

wireloose (759042) | more than 5 years ago | (#28291927)

google Fortran tutorial download

How new does the book need to be for the language standard when it hasn't changed much in 2 decades? It's a simple, easy to use tool for serious engineering.

Re:How would you learn? (3, Funny)

oldspewey (1303305) | more than 5 years ago | (#28291947)

All the good tutorials are on punch cards, so unless you have a reader handy you're SOL.

Re:How would you learn? (1)

GPSguy (62002) | more than 5 years ago | (#28291961)

Actually, my favorite, and I've taught from it is "The Fortran Coloring Book". It's not a bad intro text, a little whimsical, and covers all the basics pretty well.

Rhetorical question (-1, Troll)

Anonymous Coward | more than 5 years ago | (#28291857)

Would a Taco suck a cock if a Taco could fuck a cock?

While there may be "newer" languages (5, Insightful)

wireloose (759042) | more than 5 years ago | (#28291859)

Fortran is still one of the best, fastest, most optimized tools for number crunching. It's also very easy to write simple programs in it. No way I'd use Python for serious large data set numerical calculations.

Re:While there may be "newer" languages (1)

conspirator57 (1123519) | more than 5 years ago | (#28291901)

so is machine/assembler code, but you don't see nearly the advocacy for it.

Re:While there may be "newer" languages (0)

wireloose (759042) | more than 5 years ago | (#28291949)

Specious argument given the readability and additional expertise required to manipulate registers and stacks in Assembly.

Re:While there may be "newer" languages (0)

conspirator57 (1123519) | more than 5 years ago | (#28292243)

in order to get meaningful speed increases out of Fortran versus C you need to know many of the same things so that you can code mindful of them.

Re:While there may be "newer" languages (0)

mdwh2 (535323) | more than 5 years ago | (#28292025)

Citation needed.

Even if not phython, what does Fortran have over modern compiled languages, for example?

Re:While there may be "newer" languages (5, Insightful)

k2enemy (555744) | more than 5 years ago | (#28292115)

Citation needed.

Even if not phython, what does Fortran have over modern compiled languages, for example?

Lots of libraries for numerical work. Fortunately many of them are being ported to Python modules so you can get the speed/convenience advantage and work in a modern language at the same time.

Re:While there may be "newer" languages (4, Informative)

Falstius (963333) | more than 5 years ago | (#28292125)

Fortran has tons of libraries specialized to whatever scientific field you are working in, and is unavoidable in high energy physics especially. Of course, most of these can be wrapped in C and then used in whatever high level language you like.

Not so easy (1)

michaelepley (239861) | more than 5 years ago | (#28292045)

Fortran has all sorts of what we would now consider artificial limitations and restrictions on its syntax that make writing even simple programs a lot less simple and intuitive. For example, line length limitations, special columns, short & special variables names, etc. I'd rather not spend time teaching/learning (especially non-standard) syntax and more time on the concepts while encouraging good stylistic conventions (use commenting, readable variable/function names, etc). I found Pascal a much better first language. Not to mention that many of these programs using FORTRAN are arcane, dated in their teaching concepts, and force FORTRAN despite students who often already know many other languages.

Re:Not so easy (2, Informative)

Anonymous Coward | more than 5 years ago | (#28292091)

They ditched those line length limitations, special columns etc. twenty years ago. I suppose that is the burden of being the oldest computer language in use today: lots of people evaluate it on the basis of what the language was way back when they learned it.

No fortran - just Python (2, Insightful)

Anonymous Coward | more than 5 years ago | (#28292117)

> It's also very easy to write simple programs in it.

99% of programs are not simple any more...

> No way I'd use Python for serious large data set numerical calculations.

No way I'd us Fortran for serious large data set numerical calculations...

First I use Python - it is fastest to write and debug and has advanced data structures that simplify algorithms...
What good is that my program run one day shorter if it took me 2 weeks more to write and debug...

If I need to optimize - I am moving the internal part to C - it optimizes almost as well as Fortran...

There is Also NumPy ...

The key thing is that it is algorithms what are more important - and these are easier to write/learn
in Python - so it students should learn Python first and only some need to learn fortran..

Re:While there may be "newer" languages (3, Insightful)

MathFox (686808) | more than 5 years ago | (#28292147)

First I wonder which Fortran you refer to; Fortran 66 is quite a different language from Fortran 95. I agree that all Fortran variants are pretty good languages for number crunching, but Fortran 77 and older lacked support for data structures, making it hard to teach students about them and advanced algorithms in general. (Yes, I've tried.) Fortran 90 and 95 are much better in those respects. On the other hand: C and C++ are not so far behind in speed to rule them out.

It is my opinion that learning two fundamentally different languages makes someone a better programmer. I see value in teaching both Fortran and (for example) Python, using Fortran for number crunching and Python for smarter algorithms.

Re:While there may be "newer" languages (1)

Odonian (730378) | more than 5 years ago | (#28292297)

I say teach them the really old one I used on our PDP-8 in high school (Fortran IV maybe?). Anyway single-letter variables, some of them are ints and some are floats, and you just have to know which are which. Type in on an ASR 33 Teletype, print on paper tape to save. Fun times, fun times.

Re:While there may be "newer" languages (4, Interesting)

ChienAndalu (1293930) | more than 5 years ago | (#28292159)

Use both. I used Fortran to create some python modules at my last job, and it was dead easy. Take a look at this [] .

Re:While there may be "newer" languages (1)

pzs (857406) | more than 5 years ago | (#28292225)

Is Fortran really that much quicker than Python+Numpy? I'm genuinely interested. I do large data set numerical stuff with Python and I find the performance is pretty good. As an example, I can z-score an array of 40 million data points in less than 2 seconds.

There is also decent support for linking in more high performance stuff, using Cython or Swig. I'm also not convinced that the execution speed benefits of a dated language like Fortran stacks up against the convenience of programming in Python. I would not want to manage the kind of complexity and variety I need to deal with in a language without modern OO support.

I'd rather it took a few weeks to write and a few days to run than a few months to write and a few hours to run. I guess this depends how many runs you expect to do.

Re:While there may be "newer" languages (5, Informative)

jstults (1406161) | more than 5 years ago | (#28292251)

Fortran is still one of the best, fastest, most optimized tools for number crunching.


It's also very easy to write simple programs in it.

This is a strength of Python too.

No way I'd use Python for serious large data set numerical calculations.

It's not either/or, with F2Py you can put your inner loops in Fortran, and deal with the higher level abstractions with Python. So you get fast number crunching and all the 'batteries included' too.

How about Cobol? (2, Informative)

PIPBoy3000 (619296) | more than 5 years ago | (#28291861)

Ironically we're doing an implementation of a "new" HR system and a big chunk of it was written in Cobol. We have one guy past retirement age who knows it, but otherwise the bulk of our developers just know those fancy new languages.

Some of those older languages have a surprising amount of life left in them, out in the real world.

Re:How about Cobol? (1)

DaMattster (977781) | more than 5 years ago | (#28291933)

COBOL is geared towards business and not so much for engineering. Fortran is an engineering language and designed for complex simulations such as predicting the behavior of a fluid.

Python is just a fad. (0, Insightful)

Anonymous Coward | more than 5 years ago | (#28291873)

Unlike Pascal, Prolog, Smalltalk and the rest of the fad languages, Fortran is still here, and it will still be here when Python is long-forgotten.

I would suggest teaching them C, but it may be too complex for a first language.

Re:Python is just a fad. (1)

GPSguy (62002) | more than 5 years ago | (#28292141)

C isn't IMNSHO, too complex for a first language, but the K&R book is too thin to use for a full semester.

Honestly, C is a good choice, for a basic programming intro (I question if teaching C# while requiring Visual Studio accomplishes as much), but there are good reasons to teach Fortran to students who are not likely to become life-long, hard-core coders.

Fortran has a large code base. It was designed for FORmula TRANslation. It's easy to teach someone how to code an equation in Fortran assuming they understand the equation in the first place. C isn't too hard, but also isn't as easy (except for the veteran C programmers out there who don't know Fortran).

A bunch of our grad students and post-docs have learned Fortran over the years with little formal training, and are doing decent things with it. They hardly remember their intro C classes. Some are pretty good with perl and Python, but they've picked these up along the way to do specific tasks.

To date, I don't know of any weather models that have been coded in Python. Until someone translates 750,000 lines of crufty Fortran to Python, and makes it run with the same (verifiable) results as the Fortran code, I'll remain skeptical that Python or one of the more modern languages has that much benefit over the "old age and treachery" model (Fortran).

Re:Python is just a fad. (1)

Chatterton (228704) | more than 5 years ago | (#28292311)

Pascal is well used in the industry. C is the worst language (ever) for programming thing other than low level routines, unfortunately it has a very big list of very useful library making it appealing.

Python will be 'perhaps' fad into oblivion, but for a teaching language is not bad as it is a jack of some trades but unfortunately master of none as you can do structured programming, object oriented programming and a little bit of functional programming with it. I like it for the cleanness of it's language and use it more and more at home.

But for teaching, and i will be killed here for syaing that here, I like Visual Basic because in one well defined environment you have the code editor, the user interface editor and the debugger. And when debugging you can change your code without restarting your program making an error less costly in time and frustration for the new programmer.

In a word... (-1, Flamebait)

Anonymous Coward | more than 5 years ago | (#28291877)


Re:In a word... (2, Funny)

Anonymous Coward | more than 5 years ago | (#28291975)


You make a persuasive argument, but on the other hand, yes.

Uses (0, Offtopic)

DaMattster (977781) | more than 5 years ago | (#28291879)

My brother is both a mechanical and structural engineer and he uses Fortran for creation of simulations of simple to moderate complexity. I built him a FreeBSD box with an open source Fortran compiler and he uses this box for said work. I know nothing of Fortran myself. My brother just needed a UNIX machine and didn't want to spend untold sums of money for an HP-UX workstation. My brother seems to feel there is a lot of value in knowing Fortran. Personally, it looks evil to me. I like C/C++

Agreed, but engineers still use Fortran (1)

Bruiser80 (1179083) | more than 5 years ago | (#28291881)

MatLab is essentially Fortran.
When we did FEA work, we used NASTRAN, which still required inputs in Fortran.

That being said, I think colleges should teach more relevant materials to get them better acquainted with current standard programs.

Re:Agreed, but engineers still use Fortran (1)

conspirator57 (1123519) | more than 5 years ago | (#28291967)

matlab is an interpreted language, and thus is slow as hell. you must've meant syntactically, but even there while i despise matlab, it is better than fortran.

Re:Agreed, but engineers still use Fortran (1)

Bruiser80 (1179083) | more than 5 years ago | (#28292167)

Exactly. I meant the syntax is essentially the same. I guess you could make the case that it's also similar in syntax to a bunch of other languages...

Coding for NASTRAN was a blast. It definitely gave us appreciation for visual analyzers, near-auto meshing, and integration into 3-d modeling :-)

Re:Agreed, but engineers still use Fortran (0)

Anonymous Coward | more than 5 years ago | (#28292227)

matlab is an interpreted language, and thus is slow as hell.

wat. lol.

Re:Agreed, but engineers still use Fortran (4, Informative)

stewbee (1019450) | more than 5 years ago | (#28292143)

I did my graduate studies in a university electromagnetics lab. Two of the professors main research area was FEA. By default, we still ended up learning some even if it wasn't our research area. Most the students were pro Matlab, where as the professors were pro Fortran. As a result, if you were doing FEA for your research, you were learning fortran. If you are doing small simulations, then go ahead and use Matlab, since it will be easier to code and debug. Once you start creating 3D meshes, the number of unknowns becomes huge. At that point a compiled language is a better choice. At least fortran has complex numbers native to the language, so its implementation is a bit more elegant than say C/C++.

Re:Agreed, but engineers still use Fortran (0)

Anonymous Coward | more than 5 years ago | (#28292151)

I've had the same experience, although I never learned fortran at uni and I wish I had.

I work as a chemical engineer, and the process modelling software I use day to day (Aspen Plus and HYSYS typically) use fortran for some of their more advanced functions.

Knowing fortran - even a little bit - would be quite useful.

Re:Agreed, but engineers still use Fortran (1)

deaton (616663) | more than 5 years ago | (#28292241)

I used both Matlab and Fortran in school. I would say that Matlab is more C like in it's syntax, and considerably easier to write number crunching code. I remember having to write subroutines in Fortran that were merely a function call in Matlab, granted, several of the Matlab toolboxes were available to me, but I had to wrtite everything from scratch in Fortran.

I think that's why schools are still teaching Fortran, they are actually teaching numerical methods, not just programming, at least in the engineering programs. In fact, Numerical Methods was the title of my first Fortran class.

Fortran no, assembly yes (-1, Troll)

Anonymous Coward | more than 5 years ago | (#28291885)

Fortran holds no place today. Assembly level knowledge is key to being a brilliant mofo like me.

Python is hard too (2, Interesting)

vikstar (615372) | more than 5 years ago | (#28291891)

Isn't as hard to write fast python code as fortran code? When you're paying large money for supercomputer time, your multi-day molecular dynamics simulations better run quickly.

Re:Python is hard too (2, Funny)

sakdoctor (1087155) | more than 5 years ago | (#28291955)

                      not really.

So what? (3, Insightful)

bsDaemon (87307) | more than 5 years ago | (#28291897)

Does it really matter what language they're taught in? They should be learning the concepts of programming, not just a language. However, FORTRAN has the benefit of already having a large existing code base and deployment in the field in which students in those particular disciplines are studying. There's no reason for them NOT to learn it, and if they feel like learning Python later, then then may. Python isn't the solution for every god damned thing in the world, even if it can do it.

Re:So what? (1)

Rogerborg (306625) | more than 5 years ago | (#28292067)

They should be learning the concepts of programming

Did you spot who "they" are?

students of Physics, Chemistry, Engineering

Do you also think that carpenters should be taught the concepts of transfer of energy, elastic and inelastic collisions, and molecular bonds, rather than how to use a chisel to carve wood?

Well (1)

buchner.johannes (1139593) | more than 5 years ago | (#28291899)

The answer is that there are so many libraries readily available, especially those for certain areas of physics. With python, this is not the case.

While Fortran is old, and I'm not a fan either (and can't program it), I was surprised when I heard a presentation about a code in Fortran.
It is a high-level programming language, and aside from syntactic ugliness (like this uppercase stuff), it is as powerful as python (aside from lambda).
So let them. The effort of reprogramming the huge amount of libraries will not be paid. Maybe a good python-fortran bridge can help both sides.

Yes (1)

lxs (131946) | more than 5 years ago | (#28291907)

For their sins.

Considering Professors Teach What They See Fit (3, Insightful)

eldavojohn (898314) | more than 5 years ago | (#28291911)

Disclaimer: I went to the University of Minnesota for my BS and George Mason University for my MS both in Computer Science and I didn't learn one single thing about Fortran other then that it existed. People in other disciplines around me (ME, EE, etc) seemed to bitch about 77 versus 44 or whatever--I was too busy studying to care.

What do people in the Slashdot community think?

The easy route is just to let them teach what they want to. Professors will talk and push whatever they feel is valuable and they sure the hell aren't going to listen to a Slashdot user half their age that will get on his knees and write Java for an extra buck. If you get a whack job professor teaching only archaic languages, the University will probably hear complaints from alums about getting into the job market and wishing they had learned R instead of Fortran. I don't know about the other engineering programs but I'd sure rather be a master with R than Fortran. Is Fortran more efficient? Depends on if you're talking about cycles or amount of time it takes to write a quadratic sieve for prime numbers.

I had to learn C and I actually like plain jane C in all its simplicity. I think colleges should stick to a low level language for numerical computation courses (in my case C but I believe Fortran would function fine), an intro course to an interpreted language like lisp scheme perl whatever and should of course offer full courses in whatever is the latest craze for usable languages like C++, Java ... maybe even Ruby?

I wager this will be a hot debate and I think it's fine if people want to teach Fortran, I learned scheme and I've never used it in my professional work! Just so long as when they enter the job market, they're prepared.

libraries. gigabytes of libraries (5, Informative)

lkcl (517947) | more than 5 years ago | (#28291919)

i spoke to someone studying engineering in 1990 who was being taught fortran. they were using a mathematical library that would solve partial differential equations, by presenting the user with the actual mathematical formulae to them.

these kinds of libraries are staggeringly complex to write, and they have been empirically proven over decades of use to actually work.

to start again from scratch with such libraries would require man-centuries or possibly man-millenia of development effort to reproduce and debug, regardless of the programming language.

so it doesn't matter what people in the slashdot community think: for engineers to use anything but these tried-and-tested engineering libraries, that happen to be written in fortran, would just be genuinely stupid of them.

Re:libraries. gigabytes of libraries (0)

Anonymous Coward | more than 5 years ago | (#28292049)

why something that was written in a year and used over two decades, need millenia to be reimplemented?.

Re:libraries. gigabytes of libraries (1)

Quothz (683368) | more than 5 years ago | (#28292199)

why something that was written in a year and used over two decades, need millenia to be reimplemented?.

He said "man-millenia". Look: If you have two guys who each work one hour on a task, then you've expended two man-hours on that task, even though only one hour has passed. I've no idea whether the OP is right or not about the manpower that would be needed, but it's not implausible.

Are You Serious? (-1, Troll)

eldavojohn (898314) | more than 5 years ago | (#28292165)

they were using a mathematical library that would solve partial differential equations, by presenting the user with the actual mathematical formulae to them.

Uh, just a point of note, I believe my TI-89 from high school in 1999 solves partial differential equations. Hell, I think Mathematica could do this when I used it in college in 2003.

these kinds of libraries are staggeringly complex to write, and they have been empirically proven over decades of use to actually work.

An operating system is staggeringly complex to write yet a single man can write one. A very special man but a man nonetheless. Your mentality is fatalistic.

to start again from scratch with such libraries would require man-centuries or possibly man-millenia of development effort to reproduce and debug, regardless of the programming language.

If that's the case, it would be my inkling to tackle this problem from a new angle and I think many people already have and continue to do that.

so it doesn't matter what people in the slashdot community think: for engineers to use anything but these tried-and-tested engineering libraries, that happen to be written in fortran, would just be genuinely stupid of them.

How did we ever make progress with people like you around?

I still use Fortran for sciantific calculations (5, Informative)

sigxcpu (456479) | more than 5 years ago | (#28291925)

If all you need is to crunch numbers, Fortran is a good choice even today.
It might not be the best language to introduce someone to computer science, but it is very powerful for anything that has to do with matrix operations.

A few years ago in a physics graduate course we had a simulation project which left the choice of language to the student.
We compared performance between implementations in C C++ and Fortran.
Fortran was consistently faster by a big margin.
It's also very easy to learn.

That said, I do most of my coding in C.

Yes they should. (1)

Ed Bugg (2024) | more than 5 years ago | (#28291937)

As with any profession, in order to work effectively, you need to know the tools. Just like the classes teach notation/language of the specialty. Would anyone even think not to teach mathematical symbols for Calculus. The students will be dropped into jobs using and maintaining programs written 40 years ago.

If the majority of special written software is python, then yes the initial programming should be python. Go with what they'll need to know.

"Introductory" (1)

nine-times (778537) | more than 5 years ago | (#28291939)

Disclaimer: I am not a programmer.

It seems to me like there should be a good "introductory" language where, though the utility of knowing that language may or may not be practical, would help teach programming concepts and good practices to new programmers. That is, if the goal is really to teach programming. Usually, when you're introducing someone to a topic, it's a good idea to start with something representative and likely to instill interest in the topic.

I don't know which programming language fits the bill, though.

Re:"Introductory" (1)

Ed Bugg (2024) | more than 5 years ago | (#28291995)

It's called Pseudocode []

Yes (4, Insightful)

tygerstripes (832644) | more than 5 years ago | (#28292059)

It's called Scheme.

Re:"Introductory" (0)

Anonymous Coward | more than 5 years ago | (#28292089)

Beginner's Allpurpose Symbolic Instruction Code perhaps?
Of course, because BASIC was designed in "before structured programming" days, it lacks useful and modern abstractions.
Back in the mid 70s, UCSD used Pascal as the educational language... It provided the necessary constructs and such to learn good practices, and the instructors made no claim that you'd ever use it for anything else (since the dominant language in engineering at the time was FORTRAN, although various Algol variants were popular at UCSD).. They felt once you learned in pascal how to structure things, you'd be able to write in anything.

At UCLA in the same time frame (when they had no CS department, per se), MIXAL and PL/I (or PL/C) were the languages of choice. PL/I wasn't bad (and was implemented better than Calgol, another language used.. yet another custom variant of Algol) but it never got traction in the industry. Could it be because you had to PAY for PL/I, and C compilers were (almost) free? Clever folks those marketeers at Bell Labs..

Give it a break (1)

pjt33 (739471) | more than 5 years ago | (#28291941)

I think it's a shame Slashdot can't go a month without someone submitting a "Which programming language is best?" flame war firestarter. This has been done to death.

Fortran is weak sauce buddy (0)

Anonymous Coward | more than 5 years ago | (#28291963)

Fortran sucks.

Get those 50+ year old programmers out of the industry if they are using such an old language.

Fortran needs to retire, just like every single programmer that thinks that Fortran is worth using.

Re:Fortran is weak sauce buddy (4, Funny)

conspirator57 (1123519) | more than 5 years ago | (#28292017)

Yes, everything should be written in a fresh, clean language.

I nominate VBScript.

I learned C in engineering undergrad (0)

Anonymous Coward | more than 5 years ago | (#28291983)

I was never formally taught to use Fortran, just C. I think this worked best for me since this seemed to be the vanilla of languages and it gave me what I needed, a solid understanding of how and why to program. I did not need to know the intricacies of a specific language, that comes later depending on:

A) Where you end up.
B) What you end up doing.

So really, the language isn't the point, but more so the techniques of programming. Early courses should be basic, but challenging in that you need to know how to work with the power of number crunching and programming is the tool.

As an aside, I've later taught myself Perl and Fortran as needed and knowing the fundamentals helped.

Even NASA can't get it right (1)

Maximum Prophet (716608) | more than 5 years ago | (#28291985)

One of the staff at Purdue (back in the 80's) was a Fortran guru. He had never seen a true fortran complier, i.e. one that would pass all the standards tests. I don't know if this is any different today, but I doubt there's a compiler that will compile any and all arbitrary Fortran programs.

Besides, just write your code in a real language (one with a real grammar) and link it to the time tested Fortran libraries. What value is there in actually writing in the language?

I learned FORTRAN (1)

SailorSpork (1080153) | more than 5 years ago | (#28291987)

I had a half-year "Intro to Engineering" class at Purdue my freshmen year (1999) - Frosh Engineers weren't allowed to pick an engineering discipline until sophomore year, so we got all sorts of intro classes. In it, we first learned FORTRAN, and then we learned C.

The reason we learned FORTRAN:

* We had to compile code from one language and reference it from code in the other, to prove it was all worked the same once compiled.
* We had to have it beaten into us that, if we ever wanted to bitch about how confusion C was, all they ever needed to say is "at least it's not FORTRAN."
* They had read an article out there saying that FORTRAN coders were the highest paid coders out there, since lots of companied had legacy code and systems to maintain, and very few people cared to learn legacy languages anymore.

So yeah, it didn't kill us being part of an intro class where it wasn't the only thing we learned. Quit bitching about, it and GET OFF MY LAWN!

different languages for different purposes (3, Insightful)

rotor (82928) | more than 5 years ago | (#28291993)

There's no problem for teaching Fortran if it's the right tool for the job. It was 13 years ago that I took Fortran in College. It went great with physics and modeling courses. These days I write web-based database apps in Java/Perl/whatever language-du-jour is required of me, but I wouldn't want to use many of these languages for scientific purposes. I'll leave that to Fortran and C.

Can't change overnight (1)

fermion (181285) | more than 5 years ago | (#28292005)

I have been reading about the advances in Python for the physical sciences. I think at some point it will be a major player, and it would probably be a good idea for the undergraduate to learn it.

OTOH, we tend to teach what we know and what has worked well. This has been Fortran. It is stable, which means it is easy to get and easy to teach. Most universities has extensive mathematical and scientific libraries, which means that unless one is teaching programming, all that is really neccesary is some glue code to put the functions together.

As an aside, it is also moderately difficult to debug. While this is annoying to the undergraduate, debugging a fortran program does teach important investigative skills and encourages a level of precision that is not so necessary in some more modern languages.

Python is not programming. (2, Informative)

Weather (17370) | more than 5 years ago | (#28292033)

Python is scripting. FORTRAN is programming. MPI is vastly more supported by FORTRAN than any other language - grow MPI support for C++ or Object C, and then FORTRAN can go away.

Re:Python is not programming. (1)

vikstar (615372) | more than 5 years ago | (#28292171)

There is currently a movement to develop a language which can replace Fortran for high performance/productivity computing by focusing on parallelism, such as X10 [] and Chapel [] .

Don't fear modern languages (3, Interesting)

ZenGeek (98904) | more than 5 years ago | (#28292047)

I work at a university research lab and Fortran is still very much present. If nothing else, students need to be able to work with legacy code. I agree, however, that new projects should make use of more modern languages. Special consideration should be given to functional programming which naturally fits many science problems and is easily parallelizable due to its "no side effects" philosophy.

My Physics Degree + Fortran (1)

Brit_in_the_USA (936704) | more than 5 years ago | (#28292051)

Back in the mid-90;s I was taught Fortran (77?) during my 1st undergraduate year of my Physics Degree at Imperial College, London. We were told not to use the first 4? characters on any line as a left over form the punched cards day. This was quite amusing to myself and my fiends as most of us had been programming for years, and had PDA's that could manage a faster baud rate terminal interface to the mini computer than the 9600 baud green screen terminals we told to use. 2nd year was Fortran 90 on unix workstations so things got a lot better. By the time I was doing my PhD the computer labs Windows PC, with visual studio and C++. The course had got a lot harder during the switch and was teaching more advanced numerical methods and object orientated programing methods.

Re:My Physics Degree + Fortran (0)

Anonymous Coward | more than 5 years ago | (#28292163)

Glad they "upgraded" to Windows PC's. Must have made the number crunching must faster. ;-)

FORTRAN is better than Python (0, Troll)

tjstork (137384) | more than 5 years ago | (#28292063)

because Python is interpreted and FORTRAN is compiled. And honestly, lets admit it, the whole object oriented thing has pretty much failed and its time to pack it up and get procedural again.

Re:FORTRAN is better than Python (0)

Anonymous Coward | more than 5 years ago | (#28292291)

Yeah.. that's why languages like C++, Java and C# are so popular - because of the massive failure of OOP.

You don't have a freakin' clue, do you!

It could be worse. In fact, it was... (1, Insightful)

Remus Shepherd (32833) | more than 5 years ago | (#28292075)

When I was an undergrad, the CS requirement forced all students to take classes in Pascal.

I think the reasoning was that a student should learn a language with extreme, formal structure, and then later they can learn ones that aren't quite as strict. Maybe that the same reasoning behind teaching students Fortran? At least it's a little more useful than Pascal.

History lesson (1)

kfractal (107548) | more than 5 years ago | (#28292077)

Yes, teach it to them for historical purposes. So they see how awful it is and no one makes that same mistake again :P

I had to learn it... (1)

digitalhermit (113459) | more than 5 years ago | (#28292093)

so, damnit, everyone else better go through the same thing.

Seriously though... though I learned it as part of my CS coursework, I used it more often in the math minor portion. Lots of the examples were in Fortran, and I remember having to write Newton-Raphson and trapezoid functions. It served the purpose of showing how numerical methods worked.

I'm not certain how useful it would be in a current CS course. Today you'd just link a library and and make a call. I'm not saying that's in any way worse than how I learned it, but may not be as useful as a learning tool.

Still going to be around for a while (2, Interesting)

gustgr (695173) | more than 5 years ago | (#28292105)

In my opinion, yes. I am an undergrad Physics student (senior) and had my first contact with Fortran in my third semester, in a course called Computational Physics I. We learned the basics of Fortran 77/90 and how to solve some numerical problems using it. We also simulated some interesting problems that amazes undergrad students such as chaotic oscillators, Magnus effect in action and a few other simple yet curious systems. I had already some programming experience, but most other students didn't. They got it quite quickly and I think this is due Fortran's simplicity.

Even if you are never going to use Fortran in your own projects, you will stumble on it now and then if you are going seriously into applied and theoretical research field. NASA, for example, has tons of production code written in Fortran and even new codes are written on it. Many many Physics and Chemistry groups around the world have their most important codes in Fortran, and sometimes they use clever hacks to make the code faster, so a minimum understanding of it is necessary. I work with a Computational Chemistry group and much of the code they still develop, even for new applications, is Fortran. It is good and solid code, they are very experienced on it, and they are not willing to change to another technology so easily.

As a first language I don't know if Fortran is the best, maybe Python or Java would be my choice in this case, but it is definitely worth learning.

The real problem: programming literacy (0)

Anonymous Coward | more than 5 years ago | (#28292111)

The greatest misconception about fortran is this: although yes, it goes with heavily optimized compilers for number crunching, the real problem is beyond. The problem, as I have constantly witnessed for decades, is that the people who write fortran usually have no basic knowledge of computer science, and e.g. have never even heard of algorithmic complexity, balanced search trees, hash tables, nearest-neighbor problems, and the like. So they write, spaghetti style, very efficient code, which is then turned into very efficient object code by the compiler, implementing utterly inefficient numerical methods. I can remember blank stares when I told some of them that, despite very clever space partitioning, their nearest-neighbor search was still O(n^2), and that switching to a binary tree would obviously gain so much that they would be able to run the whole thing on a Linux box instead of a Cray.
I'm not making this up.

Re:The real problem: programming literacy (0)

Anonymous Coward | more than 5 years ago | (#28292249)

BTW: fortran is not 40 years old, but 55. Bad habits never seem to die...

PYTHON???? (5, Insightful)

Fantom42 (174630) | more than 5 years ago | (#28292127)

Are you serious? Python?

I am somewhat a Python fan boy. I love it. Its freaking wonderful for prototyping and really has a great, natural flow that reminds me a lot of pseudocode I might just invent on a napkin. Great language. But its also a factor of 30 times slower than a compiled language like C.


And Fortran is able to do optimizations (due to differences in the language for evaluation of expressions) that C is unable to do. This has to do with guarantees of ordering that Fortran does not give that C does. My point is that Fortran is even faster than C. Why do you think its still around?

The physical sciences aren't using a fast language because they are bored, or obsessed with speed for the hell of it. They use them because the problems they solve are typically deep into polynomial space, like O(n^3) or O(n^4). Having something 30 times faster means they can run 30 simulations instead of just 1. It makes a big difference to them.

I think the author of this article has lost some of this perspective.

That said, what this article should have tackled is, what do we want to teach engineering students about computer science? Right now, they take a class that teaches them C++, Java, Python, or whatever. They get some procedural programming skills with maybe a little tiny bit of object-oriented stuff (without really covering OO fundamentals IMHO, which are a more advanced topic) and they are thrown into a world where they are writing code in C for embedded controllers or Fortran for computational codes. As a result, there is a huge body of code out there written by people who know how to get the job done, but don't exactly write code that is very maintainable. They relearn the lessons of CS he hard way over 10-20-30-40(?) years of experience. Are we really giving these young students (who are not CS majors) what they need? What kind of curriculum would be ideal for someone who is going to end up writing code for something like a robot control system in C?

* I didn't really look too closely at this particular source, but I've seen numerous benchmarks all saying the same thing. If you want a surprise, go look at how LISP stacks up compared to C. It is better than you think.

University != Trade school (5, Insightful)

SpinyNorman (33776) | more than 5 years ago | (#28292153)

IMO universities should be teaching core principles and methods, not attempting to impart up-to-date job skills.

If you are going to teach FORTRAN because it's of use in the real world, then why stop there? Why not also (god forbid) teach .NET. JavaScript, C#, etc. May as well teach them Excel macros and how to interact with Microsoft Clippy while you're at it.


Teaching programming should be done in a langauge that imparts the principles easily and teaches good habits. You could do a lot worse than Pascal which was often used in this role, or maybe today just C++. I'd argue against Java and scripting languages as the core language since they are too high level to learn all the basics. You could throw in Perl, Python or any modern scripting langauge as a secondary, and for a Computer Science (vs. Physics, Engineering, etc) it's appropriate to teach a couple of other styles of programming - e.g. assembler, and functional programming.

Short answer, no. (2, Insightful)

sizzzzlerz (714878) | more than 5 years ago | (#28292185)

While used extensively in a number of scientific research programs, it isn't used commercially in any great amount, if at all. Unless the student is planning to work in an area where the language is used, there aren't any great benefits to knowing it. College should be more about leaning the discipline of software engineering, not learning a multitude of programming languages. C or Java serve that purpose perfectly well and have extensive use in the non-academic world. It it is needed at some point, learning it won't be terribly difficult if one is already conversant with other languages.

I used fortran 30 years ago, stopped using 25 years ago, and, outside of a few PhDs who use it where I work, nobody uses it for anything.

Old Fortran Code (0)

Anonymous Coward | more than 5 years ago | (#28292195)

In my area of Research, almost every program written has been in Fortran. Maybe Python would be better- i wouldn't know. But it is a lot easier to update a program written in an old language than learn a new one and start from scratch. And fact is Fortran does work and works quickly. Being 40 years old means people have spent that time optimizing the routines.'s all about the architecture, people (1)

NickBlack (1574581) | more than 5 years ago | (#28292205)

FORTRAN is still used so heavily because a) the architectures used for HPC are some of the rarest, most singularly-purposed machines on earth -- your Crays, your J-Machines, your Cell BE"s. These are not the commodity architectures for which gcc is designed; in many cases, gcc support might not even exist. In any case, it's certainly not going to have the intense and often, frankly, bizarre optimizations necessary to properly make use of these machines. Does python even allow one to manage cache prefetching, SIMD, the floating point model, etc? b) FORTRAN's easily parallelized by compilers -- even moreso than C with OpenMPI, etc -- due to the simplicity of its loop constructs and a rich heritage of automatically parallelizing these constructs (look at Ken Kennedy's work etc. google for DOALL and DOACROSS). For HPC, you're often working with massively parallel architectures, often SMID-heavy. Check out the Banerjee inequality sometime if you want to see something cool. c) Vector notation in FORTRAN is easily compiled into vector registers and operations. Python slices could probably be amenable to this, but Python isn't really ... d) Array-oriented. Everything in the microarchitecture world is designed around fast access to and operations on arrays. If you're not working in the array model, it's gonna be hard to compile it in a fashion that one can make use of architectural features designed for high performance. Language research is ongoing that seeks to address these issues. Python doesn't get there.

Depends on the version (1)

DoofusOfDeath (636671) | more than 5 years ago | (#28292209)

I'm currently porting a large Fortran 77 program to C++. I can safely say that Fortran 77 is a dangerous, bad, damaging language to teach anyone, especially impressionable young programmers.

There are several idioms in F77 that must not be taught to future generations. Probably most importantly, the use of "common blocks", and "entry" points, and the hacks needed to get around the lack of dynamic memory allocation.

I'm sure that newer versions of Fortran are more reasonable, though.

Wrong question being asked (1)

GreatBunzinni (642500) | more than 5 years ago | (#28292211)

I'm a civil engineering student who had Fortran in the curriculum. Although I don't use Fortran very often, I believe the article poses the wrong question. Instead of "why learn fortran" the question that the article's author should ask himself was "why am I forcing Python as a replacement of a tool that benefits from a battle-hardened technology that has the benefit of having a extremely serious, decades-long test on production environments in the real world?" I mean, "fortran is old" is not a technical argument. So it's first inception was decades ago. Is that even relevant?

More to the point, mentioning Python as a tool for numerical analysis is laughable, not because of having any blatant weakness but because there are a whole lot of tools that fit that job even better than Python, both in terms of speed and available APIs. If we were forced to abandon Fortran then why exactly would we adopt Python when there are other tools that are far better suited for the task? (Read C, C++, Maxima, Mathematica, Matlab, Octave, R, etc...)

What's the server programmed in? (1)

Bananenrepublik (49759) | more than 5 years ago | (#28292213)

Whatever the server's implemented in, it's definitely not fast enough.

Today's Fortran is not the Fortran of 40 years ago. Ever since Fortran 90 (i.e. for almost twenty years) the language has real dynamic memory allocation and real ways of sharing data between different parts of the program. Fortran got its bad reputation because the lack of these features caused most old Fortran code to be hard to follow -- emulating memory allocation by using lots of large arrays, and tens of lines of repeated COMMON blocks scattered all through the code .EQ.ual very opaque code. And let's not forget that those codes were written to be extremely efficient in terms of CPU time as opposed to developer time.

It's no surprise that Fortran got this bad reputation some 25 years ago when the art of language design had advanced significantly beyond what was in Fortran originally, but people who still think they need to pontificate on that point should catch up with the times -- or at least with 20 years ago.

IMHO (1)

kenp2002 (545495) | more than 5 years ago | (#28292223)

IMHO I would have to say yes. With the rise of multi-core systems I found that FORTRAN has some programming habits that would carry into multi-threaded and multi-core programming. While I don't think it has a high relevancy for finding employment I do think that FORTRAN, along with at least a 3 credit hour course in assembly is crucial for fundamental programming skills.

I think we can drop PASCAL (If they haven't already) and swap it with either Ruby or PERL for undergraduates.

Esperanto (1)

dkh2 (29130) | more than 5 years ago | (#28292233)

May as well require them to speak Esperanto too just to make sure nobody understands them.

I still work with Cobol geeks. It's actually in regular use. But I don't know of anybody who uses Fortran except for comp-sci departments. And if you're using it to teach programming practices you might as well teach said practices in a language they stand a chance of using.

High Performance Computing (1)

mdmkolbe (944892) | more than 5 years ago | (#28292239)

In the high performance computing and physical simulation world, Fortran and C are still king. In large part this is because of the BLAS, LAPACK, MPI and OpenMP libraries which are the standard libraries to use for linear algebra and parallel programming and upon which most physical simulation software is built. These libraries started out in Fortran but C ports are also widely available. Thus a new engineering graduate is much more likely to need to work with Fortran and these libraries than with Python.

Also while most code written by scientists/engineers isn't written very efficient (because they don't know algorithm design and analysis), it needs to be written in a language where someone (usually a CS person) can come in a cleanup/tune the critical bottlenecks. At that point the efficiency of the language does become important. In this field, a 3% improvement in performance can make or break you. (Yes, you can mix C and Python, but its easier to stick to one language rather than having to keep marshaling back and forth.)

Schools don't teach basics anymore (1)

gbr (31010) | more than 5 years ago | (#28292273)

They should be taught SOMETHING. I recently saw a case where a new programmer was asked to add CR/LF to the end of his text strings. Well, when we saw the code, he had done exactly as asked. Each string had "CR/LF" (the string literal) added to the end.

Newer doesn't always mean better. (3, Insightful)

Churla (936633) | more than 5 years ago | (#28292293)

Nail guns have been around for a while, but a lot of houses still get built with hammers.

If a simple tool does a job efficiently and effectively then why "change for the sake of change"?

ForTran = Formula Translation (1)

Bloody Peasant (12708) | more than 5 years ago | (#28292295)

Remember what the name means.

Because the language has been around for decades (40 years?) it has matured to the point where the libraries and compilers are highly optimised and reliable, and performance on the most significant and "heavy" computational problems has been tweaked to go as fast as possible.

Maybe in another couple of decades, Python, Perl, and other interpreted languages will come close. But not now (IMHO of course).

Bindings (0)

Anonymous Coward | more than 5 years ago | (#28292303)

From what I understand, most of the scientific computing applications of python involves using bindings to C/C++. Efficient, fast code for crunching numbers is written in the lower-level language, and the program is organized at a higher level using Python. This way the program is both easy to read and runs fairly quickly.

FI^RST (-1, Troll)

Anonymous Coward | more than 5 years ago | (#28292309)

briilIant plan Dying' crowd -
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?