Slashdot Mirror


How Not to Write FORTRAN in Any Language

gManZboy writes "In an article that's sure to p/o Fortran programmers, Donn Seeley has assembled a rant that posits there are characteristics of good coding that transcend all programming languages, except Fortran. Seriously though, his point is that early FORTRAN made coding ugly. Thus the joke 'Don't write FORTRAN' was applied to anyone with ugly code. Though Fortran has in recent years overcome its early challenges, the point -- 'Don't write FORTRAN' (i.e. ugly stuff) -- still applies."

40 of 502 comments (clear)

  1. FORTRAN - The ugly but lovable little SOB by ChuckleBug · · Score: 5, Interesting

    When I took computer programming in high school, it was all FORTRAN. We used a wonderfully dry textL FORTRAN IV with WATFOR and WATFIV. We didn't have any sort of microcomputer (this was 1980, and we were behind the times even then), but we had a keypunch, so we'd write code on a form, punch cards, rubber band 'em together, and send them off to be run on the district's big iron. Then you'd wait a week and get back a few sheet of green and white striped paper with ***SYNTAX ERROR*** all over it. And we liked it that way!

    Although that was a toothache of a programming experience, I have never lost this bizarre fondness I have for that ugly, unwieldy, but somehow cool FORTRAN. Writing that stuff makes you feel like you're talking the language of a retro-scifi computer, like the ones in the original Star Trek that spoke in that odd mechanical monotone. Robby the Robot had to
    have been programmed in FORTRAN (and NO he was NOT a guy in a suit! I'm not listening! La la la!).

    At any rate, old-fashioned FORTRAN may deserve to be bashed, but I can't help shedding a tear.

    1. Re:FORTRAN - The ugly but lovable little SOB by Anonymous Coward · · Score: 3, Funny

      "Besides, the determined Real Programmer can write Fortran programs in any language." - Ed Post

      see: http://www.pbm.com/~lindahl/real.programmers.html

    2. Re:FORTRAN - The ugly but lovable little SOB by fm6 · · Score: 4, Informative
      The problem with FORTRAN is that it was the very first high-level programming language. ("High-level" meaning a language that allows you to think in formulas and variables, not operation codes and registers.) So they had to make all the mistakes that taught computer scientists how not to write a grammar. Which mistakes produced a language that is both difficult to code and difficult to parse.

      Unfortunately, FORTRAN has achieved a role in scientific computing it will probably never lose. One co-worker of mine was a recent physics PhD who spent his entire academic career trying to persuade his fellow scientists that they'd save themselves a lot of grief by switching to C -- with no success.

    3. Re:FORTRAN - The ugly but lovable little SOB by Lodragandraoidh · · Score: 4, Interesting

      I just had a flashback to 1981...

      My highschool offered its first computer science course, and I took the first class.

      We had Apple computers running Basic, NEC (or was it NCR?) machines running Fortran, 2 terminals and a printer/terminal connected to a mini computer at school district headquarters.

      I don't recall the specifics of the version of fortran - all I recall is you would actually boot the machine into a fortran interpreter, then you would type in your program by hand and run it. We might have been able to save our application onto a 5 1/4" floppy disk not sure...

      The only printer was the terminal - so if you wanted a printout, you had to login via terminal/printer and output your program contents (provided you had typed it in previously and saved it) and/or run it to capture the output. I want to say the system could run both basic and fortran applications - so access to the printer/terminal was always tight - particularly if a project was due.

      This was my first experience with a time-sharing system - we had quotas - that if we went over the number of hours alotted we would be denied access. The eggheads in our group loved the mini and tuned up their noses at the little micros in the lab.

      I played dungeon (precursor to the Zork trilogy)on the county's computer, in addition to doing my assigned tasks, and spent many hours in the computer room after school. I recall one kid claiming to have changed his grades on that machine (apparently all of our grades were entered in the mini through terminals in the school office) - but I never validated that.

      We did a lot of flow charts and wrote our programs out before entering them in the system (or we were supposed to). Just glad we did not have to deal with paper tape/punch cards - although punch cards were to revisit me in a few years (I unintentionally played 52 card pick-up with a deck of them when delivering them to a data center - but that is another story).

      I wonder what kind of programming classes are available in highschools today? My daughter took a course involving HTML and CSS markup - but I don't recall seeing any programming classes on her curriculum. Are kids learning java/perl/python like we learned basic/fortran?

      --

      Lodragan Draoidh
      The more you explain it, the more I don't understand it. - Mark Twain
  2. fool! by Anonymous Coward · · Score: 5, Funny

    sure to p/o Fortran programmers

    You mean "sure to p .divide. o Fortran programmers.

    1. Re:fool! by pilgrim23 · · Score: 4, Funny

      -and he said with a voice quite solemn: "You'd better start int he seventh column!"

      --
      - Minutus cantorum, minutus balorum, minutus carborata descendum pantorum.
  3. Excellent points by YankeeInExile · · Score: 5, Insightful

    While I take issue with his blantant anti-FORTRANism, he makes the excellent point: Write good code in whatever language you write. Just because you can write Perl that looks like line noise does not meen you must.

    --
    How does the Slashdot Effect happen given that no slashdotters ever RTFA?
  4. Learning It? by Klar · · Score: 4, Interesting

    Thus the joke 'Don't write FORTRAN' was applied to anyone with ugly code.
    I mostly program in C, Java,php and C++(and several other languages that I dont use as much), and am always interested in picking up new languages to play around with. Is Fortran worth learning? And are there any things that it does a lot better than other languages?

    1. Re:Learning It? by Anonymous Coward · · Score: 3, Informative
      Are there things that it does a lot better than other languages?

      You're kidding, right? FORmula TRANslation was meant for solving problems in numerical methods. It is still one of the best languages in the world for solving those kinds of problems. No, it was never meant to write operating systems (but apparently is was used for at least one OS). It is also a highly portable language; iff you stay away from extensions. If you are looking for good numerical code, you probably end up at Netlib. And most of that is probably still FORTRAN. Some people have even written C/C++ interfaces to FORTRAN numerical libraries, because the FORTRAN code is still the best implementation for solving the problem.

      Yes, please do write good code. Poorly written code is a pain in any language.

    2. Re:Learning It? by phritz · · Score: 5, Informative
      Is Fortran worth learning? And are there any things that it does a lot better than other languages?

      Maybe, and absolutely. Note that the article ignorantly used FORTRAN to mean FORTRAN 66. In fact, Fortran 90 has all the features of a modern programming language. Add to that the fact that fixed-format produces far prettier looking code than C's mess of curly braces and parentheses, although you can also use free-format if you choose. Really, the article makes no sense if you look at what FORTRAN is today.

      Answering your questions directly:
      Fortran 90 does array, vector, and matrix processing better than any other language, and can do some parallelization of vector processing with a compiler flag. If you're doing scientific programming, Fortran 90 is really the language you should be using. On the other hand, for programs that are actually supposed used by laypeople, there's not much support for doing that with FORTRAN.

    3. Re:Learning It? by tie_guy_matt · · Score: 3, Insightful

      Fortran has been dieing longer than BSD has. People still write code in it, people still learn it as their first language, and there are millions of huge bug free programs that still need to be kept up to date. As many people have pointed out here, there are lots of virtues to Fortran 90 that make it worth using over other languages for certian applications. Fortran has made its way into the woodwork and it is here to stay!

    4. Re:Learning It? by TheUnFounded · · Score: 3, Interesting

      I ALMOST agree with you. As far as "standard" languages go, FORTRAN does do this best. The problem is, there's a much better solution now.

      1) Array, vector, and matrix processing can not only be done better, but with FAR less work in MATLAB, and using their converter, will nicely produce C (C++?) on the other end.
      2) Parallelization of vector processing can also be done with >version R11 of Matlab, again with many fewer lines of codes, using a toolkit. (see here)

      A couple years ago I was working on some "Cutting Stock" optimization problems. The current system was written in Fortran, but Matlab was the language of choice for the new one. Its probably more expensive, but talk about saving you some trouble in the long run...

  5. Missing something by Anonymous Coward · · Score: 5, Funny

    In an article that's sure to p/o Fortran programmers and bore the hell out of everyone else, Donn Seeley...

  6. You can write beautifully in ANY language... by Anonymous Coward · · Score: 5, Funny

    As long as you use vi. You can never write beautiful code with emacs

    I just figured I'd follow one pointless flame fest with another.

  7. FORTAN programs are small right? by FriedTurkey · · Score: 4, Interesting

    Isn't FORTRAN used these days primarily to figure out mathematical and engineering calculations? I am sure most of these programs are small and maintained by a few people. So does it matter if it is ugly? I am sure there are FORTRAN libraries to access databases but how many are really large programs??

    I have had to make changes to UNIX shell scripts and PERL code before. Most of the undocumented cryptic scripts were small enough to figure out what I needed to change.

  8. About time someone spoke up about Fortran. by bigtallmofo · · Score: 5, Funny

    Seriously, it's about time that someone knocked Fortran programmers down a peg or two. It seems impossible to get any type of programming job if you don't know Fortran.

    Every job classified ad section is filled to the brim with Fortran positions while less relevant languages like Java, C# and Visual Basic are almost completely neglected.

    I for one welcome news like this if it help Fortran programmers acquire just a little humility.

    --
    I'm a big tall mofo.
  9. FORTRAN considered useful...like SQL by dillon_rinker · · Score: 4, Insightful

    The name "FORTRAN" came from "FORmula TRANslator." It was created so that engineers and scientists could write programs to perform calculations. They wouldn't need a degree in programming, and they wouldn't be reliant on programming staff. They would be able to independently take advantage of a company's (or university's) computing resources. It wasn't DESIGNED to be a pretty language; it was designed to be used by people who would have stared blankly at you if you'd mentioned the concept of a pretty language. It served its purpose well.

    It reminds me of SQL in that respect. I have worked with managers who knew less about computers than their secretaries, but they were able to use SQL to write queries to get information that they wanted. SQL was written for that purpose. It ain't pretty, but it serves its target market.

    I doubt that designers of armored cars and dump trucks worry about the slings and arrows of the Ferrari's designers; I think this rant is pretty much in the same vein as that. Beauty and utility are not synonymous.

  10. Article format by hobit · · Score: 5, Insightful
    It would be nice



    if the article weren't broken



    into such small pieces.



    That way I could



    print it for my students.

    Sort of amusing for an article that discusses using white space in a good way.

    --
    As Nietsche famously said, "If you stare too long into the Abyss, 1d4 Tanar'ri of random type will attack you."
    1. Re:Article format by gManZboy · · Score: 3, Informative

      We are actually in the process of changing the printer-friendly version to display the article all on one page. Sorry it's not ready today, hopefully by next week.

      --
      Ed Grossman, InformationWeek
  11. Was introducting Bush/WMDs really necessary? by Saint+Stephen · · Score: 4, Insightful

    I have to say my interest in the article plunged through the floor when I saw the example using Bush/WMDs as the subject. I immediately realized I'm either reading something written by a college student or someone who has not matured much beyond that. How gauche.

    Regardless of how you feel about the politics, it's just not kosher to use examples like that. Clearly this is a person with an axe to grind.

    I read the fucking article. I didn't see too much very insightful, or see any specific reference to Fortran at all.

    1. Re:Was introducting Bush/WMDs really necessary? by tesmako · · Score: 3, Insightful
      I don't see any reason to stay off a historical fact just because it made someone look stupid. If you are this easily offended by things you read in articles I must suggest that you stay off the internet.

      Things would be different if the statement was in any way controversial, but as things stand now everyone already knows it to be true.

    2. Re:Was introducting Bush/WMDs really necessary? by FreeUser · · Score: 4, Insightful

      It even talks about leaving the UN. I don't see how it could offend anyone so much. Maybe next time the author will be more politcally correct in his examples.

      I hope not. The world is ill with political correctness. We need to be able to talk about issues, in any manner we like, without fear of reprisal.

      The new CorrectThink/PoliticalCorrectness coming from the right is even more frightening than that which came from the left ... not because of its contents (although one could make a strong argument for that: elevating the right's propensity for living in denial of Bush's machinations WRT Iraq to political correctness is far more sinister than elevating anti-sexism and anti-racism to the same level, though IMHO both are unhelpful), but because of its ever widening scope, touching every aspect of life, and every aspect of politics from micro-managed day-to-day minutia of Bush's latest behavior to general issues of philosophy and lifestyle, in ways the left thankfully never dreamed.

      People on both the right and the left should be very politically incorrect, and if a few partisans on either side get offended, so much the better. We need straight, frank dialogue, and an ability to express opinion without fear of political, professional, and financial reprisal. That is, after all, what the founding father's meant by "freedom of speech," not the corporate muzzling we have today.

      I can hear the right whining now: "We have freedom of speech, but freedom of speech has consiquences" (paraphrasing Baby Bush).

      By that definition, Communist Russia had freedom of speech. You could say anything you like, but freedom of speech had consiquences ... like landing in Guantanamo ... oops, I mean the Gulag.

      Really, the only expression that should be forbidden is one written in FORTRAN. *ducks!*

      --
      The Future of Human Evolution: Autonomy
  12. woo by nomadic · · Score: 3, Funny

    They're really starting to shake up the industry on slashdot, I'm sure this will create a lot of disruption in the massive FORTRAN industrial establishment. Oooh, next they should link an article criticizing ALGOL, that will shake up things even more.

  13. A great programming language by toddbu · · Score: 5, Interesting
    Back in the good old days before C/C++ was popular, FORTRAN was a great programming language for doing anything that had to do with math or bit manipulation. The alternatives were things like COBOL or Pascal. What I loved about FORTRAN was that you could do cool things like treat strings as ints or do negative subscripting to rewrite the OS. I had a graphics class that I wrote some FORTRAN code in because I could break down a matrix into a single row just by passing in a pointer. I loved the fact that everything was pass by reference, which is why it took me so long to switch to C. If you had an optimizing compiler you could do stuff like make 1 == 2 because the constant value 1 was mapped to the same memory location for all instances and if you passed the constant into a function then you change the constant value inside the function.

    I prided myself in college that I could write FORTRAN in any language. I had a prof that couldn't figure out why I was doing bit manipulation in COBOL. (Yes, this can be done in COBOL through multiplication and division, but it's really ugly.)

    --
    If you don't want crime to pay, let the government run it.
  14. You would have thought... by beelsebob · · Score: 3, Interesting

    ... people would have got the point. Christ even John Backus (FORTRAN's creator) said that FORTRAN and even all imperative languages were horrible ugly hack, and that we should all go away and use "[the] functional style, and it's algebra of programs".(warning: pdf link).

  15. Why use FORTRAN these days? by francisew · · Score: 4, Insightful

    Since major companies like IBM have chosen to produce compilers that perform best with FORTRAN. (absoft markets the compilers with a front end)

    I like C, and a slew of other languages much better...

    But my G5 dual-processor desktop machine can be optimized to run at around 35 GFLOPS. Try that on an 8086 derivative What, maybe you can get 2-4 GFLOPS per machine (if a dual-processor system)? I have a low-end supercomputer on my desk! Unfortunately, without FORTRAN, it wouldn't be so super.

    FORTRAN is the only language that will easily take advantage of the HW (Altivec 'velocity engine' and parallel processing).

    Each language is good for some tasks. FORTRAN happens to be good for performance in science and engineering work.

  16. How to program in any language. by adolfojp · · Score: 3, Funny

    1. Do not separate the presentation logic from the application logic. I love it when I have to search for a specific code function sandwiched between the visual element constructors and modifiers.
    2. Do not create a data layer. It is great to search through thousands of line of code to change the sql code.
    3. Use one very long class instead of separating the program's functionality into small atomic units. I just love 7th or 8th level if statements that are repeated everywhere.
    4. Don't comment or doccument anything. Good code should be self docummenting right?
    5. Don't handle exceptions. Good programs don't make em.
    6. Don't use configuration files. Because we love to recompile everything to change settings.


    Forgive my rant, it has been one long week... after another... of working with other people's code.

    Cheers,
    Adolfo

  17. Re:And assembly is pretty? by deadlinegrunt · · Score: 4, Funny

    "I, for one, look forward to the day when I can think code and have it be done instead of writing it line-by-line."

    So you have aspirations to be in management or an end user? I'm not clear here.

    --
    BSD is designed. Linux is grown. C++ libs
  18. Punched Cards and Rubber Bands? LUXURY! by Anonymous Coward · · Score: 3, Funny

    You had new punch cards to use? Back when I was in high school we had to recycle old punch cards from national elections, fill in the holes with white-out, cut new holes with our pen knife then tie them together with catgut!

  19. Why FORTRAN makes people think FORTRAN-66 (or 77) by Glomek · · Score: 4, Informative

    The p/o'd response basically sounds like "He's equating Fortran with FORTRAN-66 (or 77)".

    I know that I do this too. When someone says "It's written in FORTRAN" I don't think Fortran-95, I think FORTRAN-77... and I'm usually right.

    I suspect that there are two reasons for this:

    1. FORTRAN-77 was the big thing during FORTRAN's heyday, so most of the legacy FORTRAN code out there is FORTRAN-77.

    2. For a long time, the best Free Software FORTRAN compilers out there (g77, f2c) have been FORTRAN-77 compilers. g95 is still fairly young.
  20. A bit like Visual Basic by Mr_Silver · · Score: 4, Insightful
    I can liken this to Visual Basic. There are so many crappy visual basic applications out there designed by 14 year olds with no understanding of HCI and it's just got to a point where people go "vb? erk!" and avoid it completely.

    Which is a shame really because you should be judging the quality of the application - and not what it was written in. Seriously, if it does x and it does it quickly and well with a nice user interface - does it really matter that it was written in Algol 68?

    As a by no-means perfect example, check out this site which is, I think, a reasonably nice looking application written in Visual Basic (it acts as a GUI to the free SMS gateways out there). I don't claim to have it perfect, but the feedback I've had from people indicate that they don't think it's the usual run-of-the-mill-vb-application.

    Disclaimer: I wrote it and the preference section is a little nasty, but I'm working on it. Also, I know that VB is only really for doing RAD but I don't have the time or inclination to learn Visual C++.

    --
    Avantslash - View Slashdot cleanly on your mobile phone.
  21. Yes, older languages can be ugly... by Richard+Steiner · · Score: 5, Interesting

    ...but it's still quite possible to write readable and modular code even in Fortran 66.

    (I'm saying this as a programmer who spent 12 of the past 15 years doing exactly that -- writing and maintaining Fortran 66 code that was part of a critical production system at a major airline).

    As with any language, the onus is on the programmer who is writing the code to organize it and implement it in a way which is easy for subsequent programmers to follow and understand.

    We were able to do it even within the limits and conventions present in the environment (external variable/parameter references limited to six (6) characters, internal references limited to either five (5) or one (1) character, subroutine names limited to six characters) by using common sense and trying to use a consistent coding style.

    Yes, arithmetic IFs are ugly, computed GOTO statements can be confusing, and strings defined using Hollerith notation are strange to folks who haven't seen it before, and programs are hard to follow when everything is lined up neatly in column 7 without any spacing between code and comments. So don't use that style, avoid confusing notation, and refrain from using confusing syntax or statements which might make the intent of the program unclear.

    It's the same advice in any languages -- cute tricks might save a few bytes or clock cycles, but in a production environment it's usually long-term MAINTAINABILITY that counts -- and that's true in *any* language!

    --
    Mainframe/UNIX Bit Twiddler and long time Windows/Linux Hobbyist.
    The Theorem Theorem: If If, Then Then.
    1. Re:Yes, older languages can be ugly... by AJWM · · Score: 4, Interesting
      You left out whitespace being meaningless and implicit declaration of variables -- which can lead to things like
      DO 10 I = 1.10
      unexpectedly assigning 1.10 to the new variable DO10I instead of starting a do-loop with I as the loop variable, ranging from 1 to 10. (Which, for the non FORTRAN cogniscenti, would be
      DO 10 I = 1,10
      where the first 10 is the label of the end of the loop)

      Which led to the loss of a space probe, back in the day.
      --
      -- Alastair
  22. hardly unfortunate by hawk · · Score: 4, Interesting

    For certain purposes (including most of what I do), fortran is unmatched.

    It is *possible* to write C that runs as fast as Fortran for heavy math. However, it involves hand-optimizing your C until this happens.

    Fortran handles calculations quite well, thank you. It take less Fortran code to handle many common operations, and array options are built in and optimized to high heaven.

    With Fortran 90 and 95, the grammars that led to the CS horror (e.g., computed gotos) are marked either deleted or obsolescent (meaning expect deletion in another standard or two).

    Also, due to the selection of which features are included in Fortran and which are not, Fortran compilers can make much stronger assumptions than, for example, C compilers working with pointers.

    There's nothing unfortunate at all about Fortran's (not FORTRAN any more) role in scientific computing. The tragedy is the number of people who bought into those silly C campaigns.

    hawk

    1. Re:hardly unfortunate by YU+Nicks+NE+Way · · Score: 3, Insightful

      The point of multidimensional arrays in FORTRAN is simple and straightforward: they're contiguous blocks of storage. In C, multidimensional arrays are a fiction, because a[i][j] is given exactly the semantics of *(*(a + i) + j), instead of *(a + i * second_dim + j). That extra dereference takes away a huge number of optimization opportunities.

      Pointers are useful in systems programming, but K&R made C a much less useful scientific language by not including the multidimensional array dereference operator. That's fine -- they weren't writing a language for scientific computation. I even think they made the right design choice, since there was already one around; it was called "FORTRAN".

    2. Re:hardly unfortunate by pavon · · Score: 4, Informative
      You are misinformed. char x[5][10] does allocate a contiguous block of memory, and x[i][j] does index that memory the exactly as if you were to write *(&x + 10*i + j) !

      I know this for a fact as I have written graphics software that treated multidimensional arrays as a contiguous blocks of memory accessing it using x[i][j] notation and iterated pointer notation depending on the circumstance and both worked the same. I have also read the assembler output from a C compiler and it indeed compiled x[i][j] the same as *(&x + 10*i + j).

      To further back up my statement here is a direct quote from Kernighan and Ritchie's "The C Programming Language" Chapter 5:
      5.9 Pointers vs. Multi-dimensional Arrays
      Newcomers to C are sometimes confused about the difference between a two-dimensional array and an array of pointer such as name in the example above. Given the definitions.
      int a[10][20];
      int *b[10];
      then a[3][4] and b[3][4] are both syntactically legal references to a single int but a is a true two-dimensional array: 200 int-sized locations have been set aside, and the conventional rectangular subscript calculation 20×row+col is used to find the element a[row][col]. For b, however, the definition only allocates 10 pointers and does not initialize them; initialization must be done explicitly, either statically or with code. Assuming that each element of b does point to a twenty-element array, then there will be 200 ints set aside, plus ten cells for the pointers. The important advantage of the pointer array is that they rows of the array may be of different lengths. That is, each element of b need not point to a twenty-element vector; some may point to two elements, some to fifty, and some to none at all.

      So the notation x[i][j] will compile down to either *(&x + 10i + j) or *(*(x+i) + j) depending on whether x was declared a true multidimensional array or an array of pointers.

      One caveat (and possible source for your confusion) is that when declaring a true multidimensional array you must know the dimensions at compile time. You cannot for example declare x[width][height], and if you allocate a chunk of memory with malloc, you can access it as a single-dimensional array using the x[i] notation, but there is no notation for treating it as a multidimensional array. I have had to manually index dynamically allocated chunks of data using *(&x + 10i + j) before, and I agree it is a pain. Fortunately C++ fixed that and you can allocate multidimensional arrays at runtime and use the x[i][j] notation.

      To be fair however, I'm pretty sure that FORTRAN 77 did not have automatic or allocatable arrays either - there were some implementation-specific ways of doing it, but it was not officially added until FORTRAN 90. But I am young enough that FORTRAN 90 was my first FORTRAN, and what I know about 77 is only from historic reading, not experience, so take that with a grain of salt.
  23. FORTRAN gets its bad reputation... by alispguru · · Score: 3, Informative
    ... from scientist and engineer coders. For these guys, FORTRAN is the only reasonable way for them to turn their domain knowledge into production code, for three main reasons:

    Libraries - the most bullet-proof, battle-tested numerical code is pretty much all in FORTRAN

    Optimizers - if you must wring the last factor of two of performance out of big vectorizing iron, and you're not a CS guru, the FORTRAN compiler is still your best bet

    Semantics - FORTRAN the language enforces some constraints that make vectorizing optimization work better than less constrained stuff like C

    The problem is, for these guys FORTRAN is a means to an end - most of them have had very little formal training in good coding practice, and worse, most of the code they read was written by people with similar experience.

    Maybe what we should do is require scientists and engineers to pair-program with recent CS graduates. Both sides would learn a lot from that.

    --

    To a Lisp hacker, XML is S-expressions in drag.
  24. Re:Speed of Fortran by twiddlingbits · · Score: 3, Informative

    " it's a lot quicker to write/maintain makes most of that speed differential meaningless." No it doesn't. Some of the FORTRAN code is used in algorithms that do things like Finite Element Analysis, High Energy Physics and Weather Prediction where it is not uncommon for something to run for HOURS or run many times with different variable settings (i.e. Monte Carlo). These systems invariably use highly optimized FORTRAN code. CPU time is NOT free and often an Engineer is charged a "tax" by IT for his CPU useage over his allocation. You only save the programmer time once, you save execution time EVERY run. I've worked in the Aerospace biz many years and have never seen big number crunching programs done in C/C++ or Java. I have seen some Assembler but not much. I've also written C code for embedded systems and I do know it can be written very efficently, but it's not at all optimized for Math thus FORTRAN beats it.

  25. Re:Nothing for you to see here, please move along. by Rei · · Score: 4, Interesting

    Certainly, you can write poorly in any language. But you can't necessarily do the opposite.

    For example, I initially resisted C++. I viewed it as poorly designed objects on C (after experiencing the beautifully done objects of LPC), and programming examples for it made objects of things that never should have been objects - and as such I wanted nothing to do with it.

    However, the other features of C++ ended up proving themselves infinitely useful, and since the value of C++ objects has shot up notably in my mind. Examples:

    Templates: I can't even imagine how many pieces of code I wrote before C++ in which I wrote different versions of the same function for different variable types. Talk about a maintainance nightmare :P

    Const correctness: I remember resisting this like crazy, because it makes initial programming harder. But not only does it offer some serious benefits to the compiler at optimization time, but it's saved me many times from errors and really helped with code cleanup and refactoring into functions. My only real problem with it, now, is programmers who don't const their libraries, thus preventing me from consting variables that I need to pass to them at each step of the way.

    Destructors: I don't think I need to even get into why having your variables clean up their memory when they go out of scope is probably the best thing that ever happened concerning fighting memory leaks. You can also do garbage collection with smart pointers, but that's a topic for some other time and is less standard.

    std::vector: I can't believe that I used to not only have to clean up variable size arrays before, but used to have to have each array contain three variables - the pointer, the count of elements, and the allocated size - all of which would need to be checked and adjusted at each insertion and deletion.

    std::string: A lot easier to use than C's unwieldy strings, and easy to convert to and from regular C strings.

    I could go on for a long time... a good language can save you many programming headaches if you're willing to learn it.

    --
    We also have a halon fire extinguisher. Its always nice to have a fire extinguisher that kills people around.
  26. GPL by Bananenrepublik · · Score: 3, Informative

    Unfortunately, g95'S developer chose to rather violate the GPL than to either work together with the gcc people or at least let them use his code. Look here for more information on the split.