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

502 comments

  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 orangesquid · · Score: 1

      Who still remembers IF comparatives,greaterline,equalline,lessline? :)
      (I think this was circa Fortran IV...)

      Oh man, writing code with nested loops and multiple comparisons was a /nightmare/...

      --
      --TheOrangeSquid Is it any wonder things seem so awry? We swim in a sea of confusion and don't have to think to survive
    4. Re:FORTRAN - The ugly but lovable little SOB by TechnoLuddite · · Score: 2, Funny
      True enough ... and if you programmed on punch-cards, you got a much better understanding of the structure of FORTRAN, and why it was designed that way.

      COBOL too ... interesting that it hasn't been mentioned in either the article, or the comments I've read so far. *grin*

    5. Re:FORTRAN - The ugly but lovable little SOB by Anonymous Coward · · Score: 0

      Fortran - what kind of Fortran?

      FORTRAN (FORmula TRANslation) has it's purpose for heavy computation, and the features of FORTRAN 90/95: array-valued functions, allocatable arrays, pointers, overloaded functions and types rule, and make the code much more transparent than Fortran IV/66/77 any other language I can imagine - ever could, along comes portability.

      For the record:
      I'm doing my masters thesis in astrophysics (plasma simulations), everything is done in Fortran90/95.

    6. 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
    7. Re:FORTRAN - The ugly but lovable little SOB by Anonymous Coward · · Score: 2, Interesting

      Oh yes! - debugging arithmetic IFs and computed GOTOs makes grown men cry - following code should work OK - but illustrates arithmetic IFs:

      SUBROUTINE FOUR1 (DAT,NN,ISIG)

      c This is a Cooley-Tukey fast-Fourier trans-
      c form in FORTRAN. Transform(K) =
      c Sum(DATA(J)*exp(ISIGN*2*Pi*Sqrt(-1)
      c *(J-1)*(K-1)/NN), summed over all J and K
      c from 1 to NN. The data is a one-dimensional
      c complex arra, i.e., the real and imaginary
      c parts are adjacent in storage, as FORTRAN
      c places them. The array's length is NN =
      c 2**K. If necessary, append values to th
      c data to reach an even power of two.
      c ISIGN is +1 or -1; a -1 transform followed
      c by a +1 transform (or vice versa) returns
      c the original data multiplied by NN. The
      c transformed data are returned in the
      c array DATA, end replace the original input.
      DIMENSION DAT(*)
      N = 2*NN
      J=1
      DO 5 I=1,N,2
      IF (I-J) 1,2,2
      1 TEMPR=DAT(J)
      TEMPI=DAT(J+1)
      DAT(J)=DAT(I)
      DAT(J+1)=DAT(I+1)
      DAT(I)=TEMPR
      DAT(I+1)=TEMPI
      2 M=N/2
      3 IF (J-M) 5,5,4
      4 J=J-M
      M=M/2
      IF (M-2) 5,3,3
      5 J=J+M
      MMAX=2
      6 IF (MMAX-N) 7,10,10
      7 ISTEP=2*MMAX
      THETA=6.2831853/FLOAT(ISIG*MMAX)
      SINTH=SIN(THETA/2.)
      WSTPR=-2.*SINTH*SINTH
      WSTPI=SIN(THETA)
      WR=1.
      WI=0.
      DO 9 M=1,MMAX,2
      DO 8 I=M,N,ISTEP
      J=I+MMAX
      TEMPR=WR*DAT(J)-WI*DAT(J+1)
      TEMPI=WR*DAT(J+1)+WI*DAT(J)
      DAT(J)=DAT(I)-TEMPR
      DAT(J+1)=DAT(I+1)-TEMPI
      DAT(I)=DAT(I)+TEMPR
      8 DAT(I+1)=DAT(I+1)+TEMPI
      TEMPR=WR
      WR=WR*WSTPR-WI*WSTPI+WR
      9 WI=WI*WSTPR+TEMPR*WSTPI+WI
      MMAX=ISTEP
      GO TO 6
      10 RETURN
      END

    8. Re:FORTRAN - The ugly but lovable little SOB by exp(pi*sqrt(163)) · · Score: 1

      You had a keypunch. Lucky you. I used to have a little pin on the end of some wooden dowel and I'd push out the little squares (I've since learned to call them chads) by hand. (Does the pin thing have a name?) But we did use the rubber band! I remember one day I actually went into the place where the mainframe was and tried out the keypunch. "Wow! You could write really amazingly complicated programs if you had one of these!" I thought to myself.

      --
      Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
    9. Re:FORTRAN - The ugly but lovable little SOB by quanticle · · Score: 1, Interesting

      Are kids learning java/perl/python like we learned basic/fortran?

      If the kids are in AP Computer Science, they are learning Java, if they had the course this year or last year, or C++ if they had the course before last year (e.g. 2 years ago). However, like with FORTRAN, most of these kids are not writing good code as the instructor usually does not ever really go through the source code, but just looks at the program output. The philosophy is that, if the program works, who cares what kind of dirty tricks were used to make it.

      My first exposure to good code was really when I got a job as a web-developer and had to go through some Perl scripts written by an old-time programmer.

      --
      We all know what to do, but we don't know how to get re-elected once we have done it
    10. Re:FORTRAN - The ugly but lovable little SOB by kfg · · Score: 1

      I have never lost this bizarre fondness I have for that ugly, unwieldy, but somehow cool FORTRAN.

      I, on the other hand, cried the day they took away my timeshare on the mainframe running APL and gave me a mini running FORTRAN.

      FORTRAN I and I are the same age. Perhaps that's why I grew up to be a bit cranky and obscure.

      I'm also told I'm "cool," but I think the people who say that are a bit nuts. Maybe they've been writing too much FORTRAN.

      That'll do it you ya.

      KFG

    11. Re:FORTRAN - The ugly but lovable little SOB by Waffle+Iron · · Score: 1
      I was luckier... our high school had FORTRAN and BASIC on its single PDP-8, which we actually got to use interactively. (The card punch was hosed though, so we had to use a No. 2 pencil to hand-mark blank cards. That was enough to give anyone carpal tunnel syndrome.)

      However, about halfway through the semester the FORTRAN compiler "broke"; nobody could get anything to compile and run correctly. The teacher, who basically didn't understand the system anyway, refused to believe us and insisted that we turn in a final FORTRAN assignment regardless of the facts.

      My only recourse was to write a BASIC program that printed out a simulation of all of the FORTRAN batch gobledygook, the compiler messages, the FORTRAN source and the expected results. My non-standard FORTRAN implementation helped to avoid a lot of frustration for the class.

    12. Re:FORTRAN - The ugly but lovable little SOB by sconeu · · Score: 1

      Punch cards??? We had to use the #2 pencil bubble cards. One day, I decided to be '1337 (of course, we didn't say that back in 1976), and ran a job that just punched out 100 custom $JOB cards for my very own personal use.

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    13. Re:FORTRAN - The ugly but lovable little SOB by Billy+the+Mountain · · Score: 1

      Yep, column 7 is the start of FORTRAN code, column 1 for comments and 2-6 for numeric labels and column 80 is the end of the line.

      --
      That was the turning point of my life--I went from negative zero to positive zero.
    14. Re:FORTRAN - The ugly but lovable little SOB by Canadian_Daemon · · Score: 2, Interesting

      I wonder what kind of programming classes are available in highschools today? As a grade 12 student in British Columbia, Canada, I 've done VB and C++. The other classes (Desktop publishing etc) do html and dreamweaver. I found that in order to do Java, I had to do it by myself, without the class.
      As a side note, although our clients are Windows, the server is freeBSD, and were running OO.org. Within a year or two we should be completely switched to Linux. And some of the elementary schools in the area are alreadly pure linux.

      --
      This sig is definitive. Reality is frequently inaccurate.
    15. Re:FORTRAN - The ugly but lovable little SOB by adeyadey · · Score: 1

      As someone who also remembers handing in piles of puched cards & waiting days for the results, I would agree - C (with a decent library) is much better at the job. However in some ways it has gone to far - I find C++ & OOPs tend to bury, not reveal code functionality. APIs in particular have become so complex that it is becoming quite hard for a single programmer to write & manage a largish sized project.

      Just for example, consider what some systems require you to do to get a simple User input - define a template, fill a structure, call the API, untangle the data.. It used to be as simple as
      10 INPUT A

      While I would not like to go back to BASIC/FORTRAN, it did use to be much easier to write a useful program. These days, in a way, we need less, not more..

      --
      "You lied to me! There is a Swansea!"
    16. Re:FORTRAN - The ugly but lovable little SOB by bradleyland · · Score: 1

      Why is it that no one ever waxes nostalgic like this over FoxPro?

    17. Re:FORTRAN - The ugly but lovable little SOB by Anonymous Coward · · Score: 0

      hmm... one of the things that got me hired on, in this lab, was the porting of some old FORTRAN code, written for and old SOLARIS workstation, to get it to run on a x86 processor, under WinNT. I did it by re-writing the whole mess in ANSI C (tried just recompiling the old code, remembered how much I hated FORTRAN, decided that I'd rather maintain C code, and...)
      My biggest problem with fortran was the way that passing arguments between old legacy code and new code often required a lengthy re-write period. My second biggest issue with the 'language' was the damnable way that character spacing (i.e. having to pay attention to cursor position when typing in code -- are you past column 72 yet?) could give an obscene amount of compiler errors, when the syntax and logic were [otherwise] immaculate. That made debugging a serious PITA.
      I have a couple of FORTRAN compilers, lying around... and one machine actually has one installed... but I will resist using them to the fullest extent possable.
      For flexability, portability, &c, it's all C 4Me.

    18. Re:FORTRAN - The ugly but lovable little SOB by Tony-A · · Score: 2, Informative

      Tended to be FORTRAN for scientific computing and COBOL for business computing, with the two groups never communicating with each other.
      Then there was PL/I which allows writing FORTRAN and/or COBOL within an ALGOL structure.

      In addition to the punch-cards, remember that second generation mainframes were the equivalent of 64k bytes. Cramped, very cramped. The 7070 was 10,000 10-digit words (decimal) with three signs, which comes out in the same neighborhood.

    19. Re:FORTRAN - The ugly but lovable little SOB by Davorama · · Score: 1

      Amen. I saw lots of C++ CFD code that was abstracted to uselessness. Most science and engineering students of the time did not realize how ugly they were making things by abstracting some class for a basic operation and putting a million instances in a loop to run that operation using polymorphism.... Oops! Hey, why is the C++ version so damn slow? I saw plenty of CS grads who should have known better doing this kind of junk too.

      On the other hand. It was possible to do good work too. I was a big fan of Blitz++ and other more mundane uses of templates and operator overloading. Some of the more elegant (very easy to read but doing alot of work efficiently) code I wrote was only possible in C++. I was dissapointed that none of it would ever translate into the languages to come sense those abilities have been blacklisted by the powers of language design.

      --

      Davo -- Free speech, free software, AND free beer.

    20. Re:FORTRAN - The ugly but lovable little SOB by BuddyJesus · · Score: 1

      Ours offers BASIC, (QBASIC, to be exact), C++, Java, and a class called AP Computer Sciences that teaches much much more. Usually, high schools today teach the more commonly used languages. They often offer an easy beginner language to acquaint people with programming first.

    21. Re:FORTRAN - The ugly but lovable little SOB by blogan · · Score: 1

      My high school taught GW-BASIC that I took my junior year. The BASIC were code was:

      10 PRINT "THIS SUCKS"
      20 GOTO 10

      This was in 1997. I think after I graduated they moved to QuickBasic. We tried to do some fun stuff with GW-BASIC, like using the SOUND function to program simple songs. Or animate a stickman doing the macarena. But all those programs mysteriously disappeared from my HOMEDIR. Curse you admin!

    22. Re:FORTRAN - The ugly but lovable little SOB by skyphix · · Score: 1

      My smalltown highschool also taught only a BASIC language - TrueBasic. I took it in my Junior year as well... which was in 2000. Unfortunately, after I completed school I believe they dropped all of their programming classes. I think I might've been the only one that actually enjoyed that class... even though it was taught by a math teacher that didn't really know the language but was stuck there teaching it because of the old mentality that "math majors can program, and no one else can".

    23. Re:FORTRAN - The ugly but lovable little SOB by Anonymous Coward · · Score: 0

      "...***SYNTAX ERROR*** all over it. And we liked it that way!..."

      Luxury... my school was so far behind that we only had panel that had 8 lights on it which represented your 8-bits and you had to turn them off and on to build your instruction or data value... And we were happy with that!

    24. Re:FORTRAN - The ugly but lovable little SOB by mi · · Score: 1
      We might have been able to save our application onto a 5 1/4" floppy disk not sure...

      At best those were 8" floppies...

      --
      In Soviet Washington the swamp drains you.
    25. Re:FORTRAN - The ugly but lovable little SOB by fm6 · · Score: 1
      The problem with OOP is not the concept itself. It's the difficulty so many OOP developers have with creating a clean, simple API. The big advantage of OOP is that it makes it very easy to create sophisticated, extensible libraries. But such a library has a complicated internal structure that most users of the library just don't need to know. Too many developers of OO libraries place the burden on the programmer/user of separating user stuff (this object enapsulates a simple input stream) from library stuff (this is how the stream objects work together; this is how you create new kinds of stream objects). And even when they don't, some idiot tech writer jumbles the concepts together.

      I'm allowed to flame tech writers, since I'm one myself. Speaking of which...

    26. Re:FORTRAN - The ugly but lovable little SOB by ahdeoz · · Score: 1

      I think the solution to this is to admit that everthing is a string of characters. This is the one thing perl got right. Sure, an int is 4 bytes, and a bitmap is an array of 2**x, but they can be _represented_ as bytes, and, in fact, that's how we think of them (except in particular math intensive algorithms.) 19.95 is read as characters, and RRGGBB is seen that way. And besides, almost anything going over the network (except sound/video), is serialized anyway, so it is in fact, good old byte arrays. Once you admit this, it makes coding so much simpler, and especially, processing so much more efficient.

    27. Re:FORTRAN - The ugly but lovable little SOB by ChuckleBug · · Score: 1

      I think 6 was the continuation column, in case you wanted to wrap a line.

    28. Re:FORTRAN - The ugly but lovable little SOB by Anonymous Coward · · Score: 0

      FORTRAN >>> COBOL ::
      MIT >>> HARVARD

    29. Re:FORTRAN - The ugly but lovable little SOB by Anonymous Coward · · Score: 0

      The high school i went too, (3.5 years ago, now) had just started a Computer Science curriculum when I got there, it ended up flopping, but the years that it lasted, I got a whole year of Visual Basic, a half a year of java and c++. it's was great, good intro to the languages, well rounded. I think other high schools should do this kind of thing, have basic classes in a multitude of languages so that students see the likeness between major languages, and realize they are all fundamentally the same. and more to the poiint of the article: i'd have liked to learn FORTRAN in high school, I still see it as a requirement for database and number crunching jobs (one in the same?). but at this point, i've fallen in love with the very low-level stuff sooo, not happenin...

      Me

    30. Re:FORTRAN - The ugly but lovable little SOB by Anonymous Coward · · Score: 0

      Great Eastern Instution paralyzed around Science!!

    31. Re:FORTRAN - The ugly but lovable little SOB by lachlan76 · · Score: 1
      Last year at my high school I saw this on a whiteboard somewhere.
      IF expression THEN instruction

      IF expression THEN
      instructions
      END IF
      Made me want to be sick ;)
    32. Re:FORTRAN - The ugly but lovable little SOB by Anonymous Coward · · Score: 0
      FORTRAN >>> COBOL ::

      MIT >>> HARVARD

    33. Re:FORTRAN - The ugly but lovable little SOB by Anonymous Coward · · Score: 0

      I woz surprized when I searched for your nomenclature yesterday on Google and found but ~ four hits. Obviously those with a Rat need to be making more web posts!

    34. Re:FORTRAN - The ugly but lovable little SOB by Anonymous Coward · · Score: 0

      I remember a similar system from my college days. You would submit your stack of punch cards to be run in hourly batches and the person in front of you would forget the "end" (or was it "stop"?) card at the bottom of his stack. His program would crash & take yours with it.

    35. Re:FORTRAN - The ugly but lovable little SOB by beliavsky · · Score: 1

      >I have never lost this bizarre fondness I have >for that ugly, unwieldy, but somehow cool >FORTRAN.

      Fortran 90 makes C/C++/Java look unwieldy by comparison. Here is the classic Hello World program:

      Fortran:

      print*,"Hello World"
      end

      C

      #include
      int main(void)
      {
      printf("Hello World!\n");
      }

      Java

      class myfirstjavaprog
      {
      public static void main(String args[])
      {
      System.out.println("Hello World!");
      }
      }

      Simpler is better.

    36. Re:FORTRAN - The ugly but lovable little SOB by paulbiz · · Score: 0

      When I was in high school (12 years ago) we started with LOGO and progressed onto Turbo Pascal. The teacher never turned off the caps lock key. The screen was a giant unreadable block of yellow text. eeck.

    37. Re:FORTRAN - The ugly but lovable little SOB by Anonymous Coward · · Score: 0

      Check the post history of "Tablizer".

    38. Re:FORTRAN - The ugly but lovable little SOB by eraserewind · · Score: 1

      And people rag on perl for being unreadable. Sheesh!

    39. Re:FORTRAN - The ugly but lovable little SOB by carger314 · · Score: 0

      At my high school (I'm sixteen now) we are *still* learning Basic and Fortran. I'm sure we also have a PDP-11 floating around here somwhere too.

      --
      The price of a memory is the memory of the sorrow it brings.
    40. Re:FORTRAN - The ugly but lovable little SOB by OldManAndTheC++ · · Score: 1
      Yeah? Well when I was in junior high we too did FORTRAN programming on the big iron, only we didn't use any stinking keypunch machines. No sir, we coded each line by filling out a Scantron card, which had the same dimensions as a punchcard, but with little bubbles in the punch positions. So we had to write out the program on some graph paper, translate the characters into the punch codes, and then bubble them in. Then we rubber-banded the deck and sent it downtown where they ran it. This was around 1973-1974, I guess (Los Angeles Unified School District).

      There is no better way to learn to avoid syntax errors. The consequences of a mistake were so dire that we sweated over every line to get it right. And it was a great feeling when the program ran successfully ... even if you were just printing out the first ten prime numbers :)

      --
      Soylent Green is peoplicious!
    41. Re:FORTRAN - The ugly but lovable little SOB by Evil+Pete · · Score: 1

      Ahhh yes. Takes me back it does. Still have my copy of "Introduction to Fortran Programming: Using the Watfor compiler". The language I first learned to program in. Fortunately, by some miracle, I did not sustain long term brain damage. After that I experienced SNOBOL, which was kind of an antidote (well SNOBOL made me feel I had to run away to a commune and talk to the trees).

      Fortran. Many memories, may it rest in peace. It aint dead? Oh yes it is I say as I ram this wooden stake through its black evil heart!

      --
      Bitter and proud of it.
    42. Re:FORTRAN - The ugly but lovable little SOB by ynohoo · · Score: 1

      COBOL? did somebody mention COBOL? BTW, who are these wimp programmers who are scared of goto's? Maybe they should get a job more suitable to their skill set. I hear McDonalds are hiring...

    43. Re:FORTRAN - The ugly but lovable little SOB by Lodragandraoidh · · Score: 1

      Holy cow! This is like stumbling onto a lost pigmy tribe in the dark jungles of Central America, still speaking and writing the language of their Toltek ancestors...

      --

      Lodragan Draoidh
      The more you explain it, the more I don't understand it. - Mark Twain
    44. Re:FORTRAN - The ugly but lovable little SOB by arkulkis · · Score: 1
      That's strange... I was using 5 1/4" floppies on Apple ]['s and ][+'s in 1980. And I know that the drives were there the previous year, too.

      8" floppy? Prove that such a beast even existed. I've seen 12" floppy drives, both in the U.S. and overseas, but I have never (I say again, NEVER) seen, in over 20 years of computing, an 8" floppy drive.

      Nor an 8" hard drive for that matter.

    45. Re:FORTRAN - The ugly but lovable little SOB by mi · · Score: 1
      8" floppy? Prove that such a beast even existed.
      I really dislike having my credibility questioned.

      You could've tried Google yourself, but here it is for you anyway.

      --
      In Soviet Washington the swamp drains you.
  2. FP by nearlygod · · Score: 0, Troll

    One better... don't write RPG.

    FP?

    --
    The Tools Of Ignorance wanna be a tool?
  3. 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.
  4. One man's ugly skank... by Anonymous Coward · · Score: 0, Flamebait

    ...is another man's wife.

    Beauty is in the eye of the beholder. Perl certainly proves that.

    1. Re:One man's ugly skank... by m50d · · Score: 2, Interesting

      I think people like perl because you can do cool things in a short program with it, not because it's beautiful.

      --
      I am trolling
    2. Re:One man's ugly skank... by BlueCodeWarrior · · Score: 2

      The existence of Perl poetry says that you're wrong...

    3. Re:One man's ugly skank... by Anonymous Coward · · Score: 0

      Clearly you aren't a perl programmer. I find perl to be quite beautiful, because underneath the superficial aesthetic challenges, you can see the creativity behind the code.

    4. Re:One man's ugly skank... by colinrichardday · · Score: 1

      P. J. O'Rourke once wrote that the Dodge Viper was like that ugly date who could perform between the sheets. Is this how you feel about Perl?

    5. Re:One man's ugly skank... by m50d · · Score: 1

      I don't see the beauty in that. Beauty is all aesthetics, and I don't see any perl that's aesthetically attractive. There are perl programs that make you go "wow", one liners that creatively solve something that I would take two pages of C to do, but to me that's not beauty, it belongs somewhere else. I don't think most Picaso is beautiful either.

      --
      I am trolling
    6. Re:One man's ugly skank... by m50d · · Score: 1

      Well, typical slashdotter and all I don't really have that point of comparison, but yeah. Perl is great for short programs that I won't use again, or for when I need a program right now. But I've never found it nice to look at. If I'm writing a program I'll need to edit or can do in my own time, I'd far prefer Python or even C.

      --
      I am trolling
  5. Nothing for you to see here, please move along. by Silverlancer · · Score: 0, Redundant

    "Believe it or not, you can write good Fortran, as well as bad Fortran." Is this new? Can't any programming language be written in a "good" or "bad" fashion?

    1. Re:Nothing for you to see here, please move along. by Anonymous Coward · · Score: 0

      Lets see someone write some VB code that is in a good fashion.

    2. 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.
    3. Re:Nothing for you to see here, please move along. by locofungus · · Score: 1

      C++ also has some pitfalls not disimilar to the problems FORTRAN can bring (maybe later versions of Fortran are better)

      function.cpp

      int i; ...
      do_something(i); ...

      There is no way of telling just by looking at this code whether the value of i changes in the function call. In C you know it doesn't.

      It can be a great help when trying to trace back from a coredump where a crazy value came from to know that a function call couldn't possibly have affected the value without having to look at headers or, even worse, the source of the function.

      Another problem C++ brings to the table:


      void myfunc(myclass& c) { ...
      c.do_something(); ...
      }


      Here it is generally impossible to determine what code will be executed in the call to do_something without knowing the code for the caller to myfunc.

      These things don't have to cause problems but in the wrong hands they are perfect for writing brittle code

      --
      God said, "div D = rho, div B = 0, curl E = -@B/@t, curl H = J + @D/@t," and there was light.
    4. Re:Nothing for you to see here, please move along. by Rei · · Score: 1

      I don't get what you're trying to say in the second case - that when you make a function call, unless you have the code for that call, you can't tell what it's doing? Well, obviously. That's what function calls are for - they're groupings of code that do predictable things on a given set of inputs. What, do you want the code for all of /lib and /usr/lib interspersed throughout your code? I'm not really understanding what you're getting at.

      As for the first case, you can tell whether it changes i - if that code compiles, that means you've got the prototype for that function, and the prototype of a properly written function will be const correct. What more, exactly, do you want? Do you want users to have to specify whether they want the variable passed to be const or not? They can do that if they want just by casting, although most people find that pedantic.

      --
      We also have a halon fire extinguisher. Its always nice to have a fire extinguisher that kills people around.
    5. Re:Nothing for you to see here, please move along. by locofungus · · Score: 2, Informative

      For the second case:

      #include <iostream>

      class A { public: virtual void do_something() { std::cout << "A" << std::endl; } };
      class B:public A { public: virtual void do_something() { std::cout << "B" << std::endl; } };

      void myfunc(A& a) {
      a.do_something();
      }



      Does this code print A or B when myfunc is called? Which do_something() is executed? Unless you are using function pointers, this ambiguity does not exist in C (or FORTRAN)

      For the first case I wrote:
      There is no way of telling just by looking at this code.

      in C if I have int i; do_something(i); I know that i doesn't change. I don't need to look at the prototype (ok do_something could be a macro)

      What I would have liked is for the caller to a non-const reference to still have to write that '&'. The callee gets the benefit of the reference and anyone looking at the caller code immediately knows that there might be something happening that isn't explicit in the code they are looking at.

      In theory a smart syntax highlighter could do this but it would probably have to almost be a compiler to handle this, especially if you want it to be correct, even in the face of macros. And I don't want to have to wait for a compilation every time I load a file up into my editor.

      An editor could not handle something like:

      #ifdef REALLY_SCREW_THINGS_UP
      void shit(int& i) { i=i+1; }
      #else
      void shit(int i) { }
      #endif

      int main() {
      int i=0;
      shit(i);
      }


      But a compiler could have refused to compile unless that call in main was changed to shit(&i); if REALLY_SCREW_THINGS_UP was defined.

      --
      God said, "div D = rho, div B = 0, curl E = -@B/@t, curl H = J + @D/@t," and there was light.
    6. Re:Nothing for you to see here, please move along. by Rei · · Score: 1

      > For the second case:

      Obviously it prints based on whatever object to passed into it. That's a good thing. It's an optional benefit; if you didn't want this functionality, you wouldn't have coded it this way. I don't see the problem here.

      People extend objects precisely *because* they want this sort of thing to happen. If you created the B object, this means that you specifically did *not* want it printing A - that printing A was unacceptable to you - and that you instead needed it to print B at that point. Thanks to C++, you are able to do this. If you wanted the A behavior, you would just have created and passed an A object.

      > in C if I have int i; do_something(i); I know that i doesn't change.

      If it concerns you, do:

      int i;
      do_something((const)i);

      I mean, seriously, all you need to do typecast it. I don't see where the problem is. Do you not do const correctness? If not, I should lecture you about that - const correctness is very important for good clean code. I wish I could travel back in time to lecture myself about it when I was younger ;)

      > What I would have liked is for the caller to a non-const reference to
      > still have to write that '&'.

      And I wouldn't like that - that would be a pain. If I wanted people to force people be explicit when calling my function, I would make them pass by pointer instead of by reference. Otherwise, it's their choice: they can be explicit by adding (const) before they call the function, or they can not be explicit (concerning something that I personally would consider pedantic to do in most cases).

      > An editor could not handle something like:

      It wouldn't need to. If you're so concerned with your variables getting changed and want it to be explicit that they won't get changed, just put (const) before them before you pass them. Other people shouldn't be penalized because you want to get bothered when a function changes a variable, and yet don't feel up to putting (const) in front of your variables. Too many characters to type? Macro it.

      --
      We also have a halon fire extinguisher. Its always nice to have a fire extinguisher that kills people around.
    7. Re:Nothing for you to see here, please move along. by Anonymous Coward · · Score: 0

      You are still not getting it. It is not a major issue, but it is a minor inconvenience. The point is that C is a simpler and more explicit language, which can make it noticeably easier to figure out what a piece of code is doing. This is a good thing. This is of course balanced by other things which are easier in C++, but the main point is that the numerous complications in C++ are not entirely beneficial. Some people prefer the simplicity at the code level, even if they end up expanding their code in the process.

    8. Re:Nothing for you to see here, please move along. by locofungus · · Score: 1

      I suspect you spend most of your time looking at, and writing your own code. I spend most of my time looking at, and fixing, other peoples code.

      And references give people power. They can change what was an input parameter into an input/output parameter by changing void myfunc(int); into void myfunc(int&); and not touching the caller.

      The fact is that probably 80% of the people who write code should never have been allowed infront of an editor.

      do_something((const)i); does not compile. And even if you change it to do_something((const int)i); it still won't compile if someone has written void do_something(int&); I've seen this where do_something(int) would have been sufficient but the original programmer obviously thought "This is C++. We use references in C++". Later, another programmer makes a change to the function do_something and ends up changing the value of the parameter. Now I'm left with a situation where I know a value was correct at line 100 and was incorrect at line 200 in a different function and I have to work out where the value changed. And I didn't write ANY of this code.

      Had the first programmer written const int& then yes, the problem wouldn't have occurred. But, maybe, if they had had to write do_something(&x) if the prototype was do_something(int&) and do_something(x) if the prototype was do_something(const int&) we might get more const correctness.

      And a similar issue occurs when using polymorphism. I know things were right at one line, and I know they had gone wrong at another line but it is impossible to determine where things went inbetween. Polymorphism can be a good thing but it can, and more often than not is, be abused which leads to more maintenance headaches, not less.

      --
      God said, "div D = rho, div B = 0, curl E = -@B/@t, curl H = J + @D/@t," and there was light.
    9. Re:Nothing for you to see here, please move along. by Rei · · Score: 1

      > I spend most of my time looking at, and fixing, other people's code

      Actually, so do I. At my office, we're currently cleaning up a piece of software written in C. Because it didn't use C++'s lovely features, it's become a maintenance nightmare. Memory leaks spring up because objects don't destroy themselves and so when someone doesn't clean everything up right on returning from a function, the memory never gets freed. Passing by pointer to change variables leads to all sorts of cryptic code. To deal with the mess, they had these sprawling macros that kept getting redefined for each function. Etc. No fun.

      > (const int)i

      (const variabletype), not just (const int). Int is only the case of the example above. But I think we're on the same wavelength.

      > And even if you change it to do_something((const int)i); it
      > still won't compile if someone has written void do_something(int&);

      Exactly; that's the point. The parent wants their code to be explicit. Good for them - if they want that, it is a *coding style* issue, and they can do it. If they think something is const and it isn't, congratulations - they just found a bug!

      As for me, I indent with four spaces, use brackets lined up with the entry condition, only use tabs for comments, prefer // to /* */, and don't cast all of my variables before function calls. It's all style, however - just like whether you cast before function calls or not.

      > And I didn't write any of this code

      Congrats, you're debugging code of bad programmers. If they were bad programmers writing in C, you'd instead be tracing down spots where they misused pointers that were passed all over the place. And lets not even get into the other things you'd be dealing with (especially related to memory - bad programmers plus memory that doesn't clean itself up equals a disaster).

      If you're having to deal with this poorly written code all of the time, your first step should be refactoring, not debugging. Const everything, strip out as much code as you can into function calls, group variables that tend to follow each other around into objects and then move function calls that they tend to get used on to the objects themselves, etc. There are a number of good books on refactoring out there.

      In the process of consting things, you'll end up exposing functions that don't seem like they should be changing variables but actually are (among many other likely bug-causing situations). As you break code into smaller functions and group variables into objects, you increasingly gain the ability to const entire member functions. Errors start getting thrown where variables are being changed when they shouldn't be; the code ends up a whole lot cleaner.

      > I know they had gone wrong at another line but it is impossible to determine
      > where things went inbetween

      Of course it is possible. You put debugging statements or breakpoints in the called object possibilities for the function; it's no harder than if than if there was no polymorphism and you were using flags or duplicated functions to represent the situation instead of polymorphism (which, by the way, would produce far uglier code). Plus, properly done objects, when you use polymorphism, will have a way to identify themselves. Heck, my boss has been pushing our lab toward not just including debugging information, but outright self-test modules into objects.

      And if you don't believe that polymorphism aids in maintenance, try out ITK some time. That's just a beautiful C++ paradigm. Trying to implement such an imaging library in C would give you the most god-awful bug prone spaghetti code, but using C++ keeps it nice and orderly. Cleans itself up, does its own garbage collection via smart pointers, every image can have itself using any datatype that it wants (thanks to templates - any number of bits, grayscale, RGB, YUV, etc), and you can build images off of each other (thanks to polymorphism); since transforms work on basic images, all transforms can work on any new type of image with any datatype without any new code (thanks to both templates and polymorphism); internalized self-test; etc. We use it in medical imaging.

      --
      We also have a halon fire extinguisher. Its always nice to have a fire extinguisher that kills people around.
    10. Re:Nothing for you to see here, please move along. by dkf · · Score: 1

      In theory a smart syntax highlighter could do this but it would probably have to almost be a compiler to handle this, especially if you want it to be correct, even in the face of macros. And I don't want to have to wait for a compilation every time I load a file up into my editor.

      FYI, this is what modern IDEs do using things like incremental compilation. Not that you should take this as meaning I'm a fan of them though; they're also slow memory-hungry pigs (and they tend to not let me use either emacs or vi key-bindings either, the heathens!)
      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
  6. 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?
    1. Re:Excellent points by YankeeInExile · · Score: 2, Insightful

      Let me add to that -- writing well in Human Languages is important too. Otherwise you're going to lose your audience of yore with loose usage.

      --
      How does the Slashdot Effect happen given that no slashdotters ever RTFA?
    2. Re:Excellent points by Anonymous Coward · · Score: 0

      If you 'get' perl, the line noise is sweet music and more elegant than python gobblyguck!

    3. Re:Excellent points by el-spectre · · Score: 1

      Yeah, but if you want someone else to be able to edit your code, it should be readable.

      Stuff I write just for me (small utilities, etc.) can be 'clever'. Production stuff that others will need to work on is 3 times the size, but readable.

      --
      "Faith: Belief without evidence in what is told by one who speaks without knowledge, of things without parallel." - A.B.
    4. Re:Excellent points by Tassach · · Score: 1
      Just because you can write Perl that looks like line noise does not meen you must.
      You mean that you can write Perl that doesn't look like line noise? WhodaThunkIt.
      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
    5. Re:Excellent points by rmohr02 · · Score: 1

      Or, if you do a line of Perl that looks like line noise, explain what it does with comments. Not that I specifically look for the "line noise" way of writing code, but sometimes it just comes more naturally to me (and yes, I know, I've been using Perl way too much).

    6. Re:Excellent points by Anonymous Coward · · Score: 0

      I thought the point of perl was to write code that no one could decipher later. It was a form of "job security"...

      Atrivis

    7. Re:Excellent points by Anonymous Coward · · Score: 0

      Perl's no more confusing than C, bourne shell, awk, smalltalk or BASIC. Which is more or less what Perl took ideas from.
      If you don't grok regular expressions, then go read up on them. They're a part of many languages, no exclusively Perl.

    8. Re:Excellent points by gstoddart · · Score: 1
      Just because you can write Perl that looks like line noise does not meen you must.


      But everyone does nonetheless. :-P

      --
      Lost at C:>. Found at C.
    9. Re:Excellent points by Smooth+Hound · · Score: 1

      Perhaps we should update the quote. Now it is: "You can program in Perl in any language"

    10. Re:Excellent points by winterlens · · Score: 1

      Wasn't it Knuth who said that being a good programmer required being a good writer?

    11. Re:Excellent points by Tony-A · · Score: 1

      Good point.
      There is a distinction between what something does and how it does what it does.
      As long as it is doing what it should be doing, I should not have to look into how it is doing it. Only if it fails to do what it should, then it gets unwrapped and becomes much much longer.

      Try writing explicable regular expressions ;)

  7. 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 grub · · Score: 1

      Fortran was used a lot in the scientific and engineering fields. At work our SGI machines have current Fortran compilers on them. The code splits up to work across multiple CPUs quite well. Personally I don't think I've touched a stitch of Fortran since the CP/M card was installed in my old Apple ][+.

      --
      Trolling is a art,
    2. Re:Learning It? by What'sInAName · · Score: 2, Informative


      Well, I'm by no means an uber-coding guru, but I used to prgram in C, and I just finised a three-year job writing many little programs in Fortran 90. I liked it, for what it is. The modern variants of Fortran are, in general, much nicer to look at, and if you know C and/or other languages, you could probably pick it up pretty easily.

      I think I found basic i/o to be much easier in Fortran than C, but then that might be because my C is so rusty I have to keep re-looking everything up. Oh well.

      For a (mostly Fortran-like) language that has a free compiler, you might also take a look at F as well. (http://www.fortran.com/F/).

    3. Re:Learning It? by ackthpt · · Score: 1
      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?

      No real reason left, unless you're trying to decypher some FORTRAN to convert to something else. It's major charm, among engineers, was the complex math library, which you can pretty much throw into anything you like now, though i don't know about Visual Studio stuff (there may be complex datatypes and library, I just haven't looked for them) I developed a complex math library for C about a decade ago.

      --

      A feeling of having made the same mistake before: Deja Foobar
    4. Re:Learning It? by Silver+Sloth · · Score: 1

      If you have the time/resources it's fun to learn another language just because you can. On the other hand, if you want to write real, maintainable code then why use a dead/dieing language. It would be like writing your documentation in latin!

      --
      init 11 - for when you need that edge.
    5. Re:Learning It? by achacha · · Score: 1

      No. I took Fortran and Pascal in college and despite the fact Pascal had problems, I almost always tried to write the code in it instead of Fortran because the Fortran code was ugly and unmanageable and worse after 2 weeks I couldn't figure out why I wrote something (yet I have written C/C++ code 8 years ago that I still can read and understand why I did something.

      Like any language Fortran had it's uses back in the 80s as a language well suited for mathematical computations, but with availability of C/C++ and tons of 3rd party math libraries there is no reason to use Fortran. I think using Mathematica is a lot more elegant if you must use something math oriented and that is what many math based researchers use (albeit they often have supercomputers or clusters avaialble to them to cruch those problems anyways).

      My advice is to stay away from it unless you like learning languages of old, then I can recommend Logo and APL to you also :)

    6. 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.

    7. Re:Learning It? by Anonymous Coward · · Score: 0

      It is the only one I recall with *NATIVE* support for complex numbers. That alone made it popular with the X-ray crystallography crowd in particular, although it was the main axe of most engineers and scientists of my age and older back in our formative years.

      'Course, you can write a class for complex numbers, complete with overloaded operators and all in C++, so you don't really need Fortran any more, unless it's to confound those whippersnappers and all their perl and php and the like.

    8. Re:Learning It? by avandesande · · Score: 2, Informative

      The special thing about Fortran is that you can process a whole vector instead of using a for() loop. This makes it easy for compilers to break up tasks among multiple processors.

      --
      love is just extroverted narcissism
    9. Re:Learning It? by Anonymous Coward · · Score: 0

      Uh, no.

      Try Ruby, Lisp, Scheme, Smalltalk, Haskell...if you want to go for an old language try Lisp.

    10. 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.

    11. Re:Learning It? by mmkkbb · · Score: 1

      doesn't gcc include a fortran compiler? (g77?)

      --
      -mkb
    12. Re:Learning It? by Anonymous Coward · · Score: 0

      Like any language Fortran had it's uses back in the 80s as a language well suited for mathematical computations,

      SYNTAX ERROR

    13. Re:Learning It? by ajs · · Score: 1

      Some people have even written C/C++ interfaces to FORTRAN numerical libraries

      MANY languages have wrappers around netlib and other giant fortran numerical libraries. The reason being that 99.9% of the programmers who need access to parts of that code could never even BEGIN to re-write it in another language. That code will likely be with us well after the name FORTRAN is forgotten.

      Perl's PDL (Perl Data Language) is a very nice abstraction for dealing with almost any sort of numerical data, and it uses netlib as a back-end as well as serveral other tools in C and Perl.

      I'm sure other languages have similar tools.

    14. Re:Learning It? by ajs · · Score: 1

      Many languages have native complex support including modern C++. Perl 6 will be offering an interesting array of options for complex support as a built-in type, and I'm pretty sure Python already does this.

      Those are just some off the top of my head.

      If you were to say that FORTRAN *was* the only language with native complex number support back when it was popular, then I would agree.

    15. Re:Learning It? by Peter+La+Casse · · Score: 2, Informative
      doesn't gcc include a fortran compiler? (g77?)

      It does, but it's starting to show its age. There's a new GCC Fortran 95 compiler under development ("gfortran") that will be officially released with GCC 4.

    16. 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!

    17. Re:Learning It? by Anonymous Coward · · Score: 0

      So why not just go to APL right away?

    18. Re:Learning It? by fejikso · · Score: 1

      I mostly program in C, Java,php and C++(and several other languages that I dont use as much)

      My brain had a fatal error when it tried to compile your sentence.

    19. Re:Learning It? by mz001b · · Score: 2, Informative
      There's a new GCC Fortran 95 compiler under development ("gfortran") that will be officially released with GCC 4

      and an even better, almost working one, g95 -- this is the code base that the gfortran people forked from. gfortran does not work, and is much further behind than g95.

    20. Re:Learning It? by PureCreditor · · Score: 1

      in Java 5 there's "foreach" ....

      seriously, if you have complex formulas, use mathematica. if u have a huge dataset, use SAS. Re-designing wheels in FORTRAN is a waste of R&D

    21. 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...

    22. Re:Learning It? by DoctorRad · · Score: 2, Informative
      For a (mostly Fortran-like) language that has a free compiler, you might also take a look at F as well. (http://www.fortran.com/F/).

      Seconded. F is a subset of Fortran95, with all the deprecated syntax options taken out. This promotes good coding style. Any F program will compile with a f95 compiler, so you can get the same code running on much bigger machines very easily.

      Matt...

    23. Re:Learning It? by twiddlingbits · · Score: 2, Funny

      The REAL Math whizzes in college used APL and wrote complete programs in one line. Damn showoffs, I still hate thier guts! Good thing they work for ME now ;)

    24. Re:Learning It? by Kiryat+Malachi · · Score: 1

      Only use Mathematica if you need symbolic notations.

      If you're just doing numerical analysis, and *especially* if you're doing vector/matrix work, just use MATLAB.

      --

      ---
      Mod me down, you fucking twits. Go ahead. I dare you.
      (I read with sigs off.)
    25. Re:Learning It? by hawk · · Score: 1

      Basing judgemnt of Fortran on anything you did in the 80s is as silly as using K&R to criticize C . . .

      For the problems for which Fortran is well suited, Mathematica is not--unless delaying the results until after your retirement is important.

      hawk

    26. Re:Learning It? by jellomizer · · Score: 1

      Hey it is a big help to me. I took a class in FORTRAN for fun in college. And now I just got a big account because FORTRAN programmers are so hard to find. (Many who can write FORTRAN won't admit it) so I am writting FORTRAN on a Digital VAX. Knowing obscure languages really do help out though. The more languages you know the easier it is to learn other ones.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    27. Re:Learning It? by Aardpig · · Score: 1

      My advice is to stay away from it unless you like learning languages of old.

      Well, we won't be taking your advice, because you obviously haven't got a fucking clue. New Fortran language standards were issued in 1990, 1995 and 2003/4, keeping Fortran the language of choice for all numerically-intensive tasks.

      C/C++ have attempted to replace Fortran, but have serious language problems (such as argument aliasing) that prevent compilers from optimizing code to the same degree as Fortran. Furthermore, contrary to your claim, there simply isn't a C/C++ library resource that comes anywhere close to the Fortran Netlib repository.

      Mathematica is a nice product, but it deals with Math, and Math != Numerical Simulation. Mathematica is useless for serious computations, of the sort that would run on parallel computers.

      --
      Tubal-Cain smokes the white owl.
    28. Re:Learning It? by Anonymous Coward · · Score: 1, Informative

      What about APL? If you're in for cryptic but powerful languages, of course.

    29. Re:Learning It? by Kiryat+Malachi · · Score: 1

      Because MATLAB exists.

      Or Scilab, if you're broke.

      --

      ---
      Mod me down, you fucking twits. Go ahead. I dare you.
      (I read with sigs off.)
    30. Re:Learning It? by vsync64 · · Score: 1

      Common Lisp has complex numbers natively.

      --
      TO BUY A NEW CAR WOULD MAKE YOU SEXUALLY ATTRACTIVE.
    31. Re:Learning It? by slackerboy · · Score: 1

      A better question is how you can learn FORTRAN these days. Most U.S. universities (including engineering/science focused ones) have phased it out of their undergraduate programs. (You may still run into it as an aside in an upper level class.) When I started my most recent job, I had to pretty much teach myself FORTRAN so that I could maintain undocumented (and uncommented) FORTRAN-77 code. Not fun stuff, but I now have another skill to put on my resume.

      --
      Things to do today: See list of things to do yesterday
    32. Re:Learning It? by umshaggy · · Score: 1
      "Fortran was used a lot in the scientific and engineering fields." [bold emphasis mine].

      FORTRAN is STILL used heavily for scientific computing. Many supercomputers and vector computing systems have compilers that are heavily optimized for FORTRAN code.

      I'm a "young'un", having only been coding for about ten years and only being out of college for about four. But I've had to work with FORTRAN for work before, and haven't found it to be a particularly bad language.

      Interesting though, I did end up having to implement my own calling stack so that I could use a recursive algorithm (FORTRAN 77 does not support recursion). It was fun! And to think, I thought it was funny when my CS professor taught us how to do that in C++ a couple years earlier :)

      --
      Q: Is God REAL?
      A: Yes, unless declared INTEGER

      --
      Did you buy a Neuros today?
    33. Re:Learning It? by Wavicle · · Score: 1

      I have a set of 1000 weakly or strongly interacting particles. The matrix modeling their interaction is 1000x1000.

      If I use Java 5's foreach, is that going to be more efficient than a semantic expression of what vector operations I'm doing? Will Java 5's JIT recognize that I'm doing a vector operation and switch to vector instructions to handle it?

      Will mathematica invert a 1000x1000 matrix before my next performance review cycle?

      Seriously, fortran is useful for hard core numerical computation. You don't want to do your finite element analysis in Mathematica or Java.

      --
      Education is a better safeguard of liberty than a standing army.
      Edward Everett (1794 - 1865)
    34. Re:Learning It? by grub · · Score: 1


      FORTRAN is STILL used heavily for scientific computing

      Yes, my mistake. In fact elsewhere in the comments I make reference to the Fortran compiler still in use on our SGI machines at work.

      --
      Trolling is a art,
    35. Re:Learning It? by Anonymous Coward · · Score: 0
      for the love of all that's holy, NOOOOOO!

      actually, it can be a useful thing to know, if you want to access/use old legacy code (e.g. GAMS, &al.) -- there's a lot of old code that was written in FORTRAN that you can take advantage of, if you are a maschochist (FORTRAN doesn't really play well with other languages e.g. passing arguments, linking, &c.).

      myself, I haven't had to use FORTRAN in over 3 years, and hope to never have to load up another FORTRAN compiler again. I'd sooner re-write the old code in ANSI C (I've done this in several cases).

    36. Re:Learning It? by raga · · Score: 2, Interesting
      Is Fortran worth learning?
      For number-crunching applications, it is the greatest.

      it has a strict but simple syntax (far fewer ways you can make unintentional errors, unlike, say C++)

      it is blazingly fast (only writing in Assembly code could likely beat it in speed)

      it has great compiler flags for parallel processing and optimization (just make sure you have "clean" code that doesn't jump in and out of loops)

      it is easily portable (I can run code written for the CRAY X/Y-MP in the 1980s, on a G5 in 2005)

      it has a well tested and supported library for almost all types of numerical methods and heuristics.

      Other than that, it is pretty much worthless.{grin}

      cheers- raga

    37. Re:Learning It? by Cro+Magnon · · Score: 1

      I'm sure it still has its uses. After all, I'm still maintaining stuff written in the other dying/dead language (Cobol). Both languages have reached critical mass (or is it critical mess?).

      --
      Slow down, cowboy! It has been 4 hours since you last posted. You must wait another few hours.
    38. Re:Learning It? by umshaggy · · Score: 1

      Ah. Point. Sowwy. Didn't mean to sound quite so contradictory; I agree with your comment.

      --
      Did you buy a Neuros today?
    39. Re:Learning It? by PureCreditor · · Score: 1

      you really should try benchmarking that on Matlab and Mathematica. You save a lot more time in code development. So then, now you'll have to look at coding time savings vs. runtime savings. I never programmed in Java 5, so I can't speak of it's power. If you need your 1000x1000 matrix so desperately, might as well directly code SSE or Altivec ?

    40. Re:Learning It? by Anonymous Coward · · Score: 0

      It's all in the implementation; Doing vector work in FORTRAN is orders of magnitudes faster and more readible than in Perl 6 or "Modern" C++. More so on modern implementations that support automatic clustering and other parallelizing constructs...

    41. Re:Learning It? by lgw · · Score: 1

      You can't touch Fortran for speed in heavy math, especially for vector operations, especially on highly parallel machines. However, this is really a product of the libraries, not the language. There are fortran library wrappers for several languages that are much easier to maintain (C++, Python, etc), so you can have the best of both worlds.

      While there are other good math libraries, the number of man-years spent optimizing the common Fortran libraries is just obscene. It would be quite silly to re-invent that wheel.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    42. Re:Learning It? by Anonymous Coward · · Score: 0

      Yeah, I hear that the Hurd was going to be compiled with gfortran...

    43. Re:Learning It? by legrimpeur · · Score: 1

      actually I tried both on my powerbook. gfortran frequently choked on my codes where g95 was just compiling. Performancewise however g95 sucks, I mean it REALLY sucks. It was generally more than ten times slower than gfortran. By the way gfortran, being part of gcc 4.0, supports loop vectorization. cheers

    44. Re:Learning It? by The+boojum · · Score: 1

      Aye! I was thinking the same thing, though I'd put OCaml (or SML, if that's your flavor) up there as well.

      I've come to believe that Perlis had it write when he said: "A language that doesn't affect the way you think about programming, is not worth knowing." Getting comfortable with functional languages has definitely affected the way I program, even when I'm writing C++ code. I can look at something like a functor object and think, "oh, that's basically just an explicit closure." It's been very enlightening, especially since it seems like many of the idioms from the functional world have started creeping into the mainstream lately. To me, I find it much like adding a new set of design patterns to the toolbox -- it gives you a handle on the concepts and a vocabulary to refer to the ideas by even if you don't code in a functional language.

    45. Re:Learning It? by iamacat · · Score: 1

      Easy. He is saying he uses C, Java, PHP and C++ more than anything else, but it takes at least six languages to get to more than 50% of his programming. Also he doesn't use any other language exactly as often as one of the first four.

    46. Re:Learning It? by MurphyZero · · Score: 1

      I was asked to maintain some fortran code recently. it was an upgrade from the actual safety critical software we use. We used it to check the expected results. The operational software has been set for upgrade for the past 15 years (government of course) and it looks like it will last at least another 10 before it is replaced.

      --
      Our founding fathers removed the guys in charge. Be American. Vote incumbents out.
    47. Re:Learning It? by coats · · Score: 1
      Will mathematica invert a 1000x1000 matrix before my next performance review cycle?
      Actually yes! because of the Fortran library it calls to actually do the work (Mathematica has enough native smarts to do that :-) )
      --
      "My opinions are my own, and I've got *lots* of them!"
    48. Re:Learning It? by sl3xd · · Score: 1

      It's unimaginably trite to talk about code development time when that isn't the critical issue for scientific computing. It's a typically weak CS response who want to get their part of the work done as lazily as possible. There are cases where development time is inconsequential to the runtime, and scientific computing is one of them.

      For serious numeric computation, you're going to be using a supercomputer; not some wimply workstation. You generally can't access them when you want, as long as you want, or as often as you want. If you have an hour on a supercomputer, you want to get the most work done in that hour as possible; you wait weeks or months just to get a timeslice; you don't waste ANY time doing development on a supercomputer -- development has to be finished before you even sit down at one of its terminals.

      You carefully develop the code for weeks to get maximum throughput; then you finally get a timeslice scheduled when you are finished with development-- and then you have to wait until your timeslice is available, during which you can pore over the code again and again. Development time isn't even a factor; runtime is the thing that the developer is limited to. Many of these operations are so long and intensive you actually DO save time by spending weeks and/or months programming it in Fortran, rather than using something like MatLab, Mathematica, or Java.

      --
      -- Sometimes you have to turn the lights off in order to see.
    49. Re:Learning It? by allanc · · Score: 1

      There are no huge, bug-free programs in Fortran.

      There are no huge, bug-free programs in *any* language.

      "Every program contains at least one bug and can be reduced by at least one line of code. From which we can deduce that every program can be reduced to one line of code that doesn't work."

  8. 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...

  9. Oy.. The code I've seen.. by ackthpt · · Score: 2, Interesting
    I took over from a guy with a Masters Degree, who only took Fortran in his day and everything he wrote looked like it. (He also was a pretty bad coder besides, with at least one variable spelled three different ways in one module. eek)

    I'm more of a western coder ... lots of wide open spaces in between clauses for readability. Documentation in bits rather than 100 lines of code then a paragraph about what happened in there.

    I'm sure someone somewhere would gripe about my style too.

    --

    A feeling of having made the same mistake before: Deja Foobar
  10. 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.

    1. Re:You can write beautifully in ANY language... by Anonymous Coward · · Score: 0

      real men use ed :p

    2. Re:You can write beautifully in ANY language... by Mark+of+THE+CITY · · Score: 1

      ... as long as you use VAX/VMS EVE, which unlike emacs stopped at being a highly flexible text editor, and didn't try to be a virtual machine as well. :)

      --
      The clearance system sounds logical. It is not. It is completely arbitrary. -- John Bolton
  11. 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.

    1. Re:FORTAN programs are small right? by grub · · Score: 1

      primarily to figure out mathematical and engineering calculations?

      Yep, and you'll see SGI, Cray, et al, offering up-to-date Fortran compilers for their big iron.

      --
      Trolling is a art,
    2. Re:FORTAN programs are small right? by YankeeInExile · · Score: 2, Informative

      I am sure most of these programs are small and maintained by a few people.
      Actually, most production FORTRAN systems are beheamoth systems for modeling very complex behaviors. Although the community that keeps these systems up-to-date is probably relatively small.

      But not always: My friend Carl was writing CGI in FORTRAN to run on the XKL TD-1

      --
      How does the Slashdot Effect happen given that no slashdotters ever RTFA?
    3. Re:FORTAN programs are small right? by BenjyD · · Score: 2, Interesting

      I was part of the last year at my Uni to learn Fortran-77 (studied 1997-2001, chemical engineering). They teach Maple now, I think.

      Yes, FORTRAN is very common for engineering calculations: I've written things like distillation column models in it. It's fast, simple and there are lots of numerical libraries for it. I wouldn't want to use it on a project I had to maintain, but for getting the job done it's pretty good.

    4. Re:FORTAN programs are small right? by Scarblac · · Score: 2, Interesting

      SMALL?

      When I did some lab as part of my CS study, one unfortunate group of four students got the assignment to write documentation for part of some FORTRAN behemoth written over 15 years by successive grad students in the math department. It was horrible.

      It was worth four credits (= 4 weeks), so documenting part of that small program was supposed to take four man months.

      Our group wrote a GUI in Tcl/Tk interfacing VTK to show nice 3D graphs of the output of that program. We were lucky we could look at some smaller FORTRAN programs that were used to parse the stuff before then, only a few thousand lines, but it was still hardly possible to figure out what was what.

      No namespaces...

      --
      I believe posters are recognized by their sig. So I made one.
    5. Re:FORTAN programs are small right? by gmletzkojr · · Score: 1

      Sometimes.
      I know a company (ugh, ok, I work for them - but the company is not Verium Systems in my url) that has written several train simulators that use FORTRAN as a back-end for calculations. It is quite the beast. Appearently, several engineers spent man-years coding this thing up years ago, and no one knows what it really means or does.

      As an aside, the rest of the simulator is written in VB, and uses about 5-6 PCs.

      --
      I for one welcome our new [insert main topic] overlords.
    6. Re:FORTAN programs are small right? by Booker+C.+Bense · · Score: 2, Insightful

      Actually, real fortan programs tend to be quite large.
      Not OS large, but 10 to 100 megabytes of source code is not
      uncommon. The typical program is hacked on by grad
      students two or three at time over the progress of years.

    7. Re:FORTAN programs are small right? by CanSpice · · Score: 1

      Small? There's a software collection I run (and used to be in charge of the porting efforts to OS X for) that's about 2.5 million lines of code. Of that, 800,000 are FORTRAN (the rest is C, Java, C++, and Tcl, primarily).

      I definitely wouldn't call 800,000 lines of code "small".

    8. Re:FORTAN programs are small right? by jejones · · Score: 1

      I am sure most of these programs are small and maintained by a few people.

      Uh... Google for LINPACK, EISPACK, LAPACK et al. These are pretty hefty pieces of code, written and tuned to a fare-thee-well to do what they do as well as possible. If you know the algorithms, you have a leg up on understanding the code, but at least in the old days (I can't vouch for FORTRAN 9x), you had to write out explicit loops to express what math notation does with much greater concision. Memory constraints and the wish to deal with large problems led to very ugly and error-prone methods of reusing storage (some time, with a safely empty stomach, look up EQUIVALENCE).

    9. Re:FORTAN programs are small right? by Frumious+Wombat · · Score: 1

      I think the small fortran program around here is 20K lines, while the big ones are closing in on a million or so. Most Number crunching code is actually rather complex. Note: these are Real Lines, not girlie-man C lines with one { on them. You can do anything you'd ever want to with Fortran. I've seen OO F77, and I've seen CGI scripts written in it. (in a language where text processing was an extension from the 70s). The predecessor to Zork was written in Fortran as well. It has achieved immortality, and shall never die. Where is Ada? Where is Algol? Whither Smalltalk? FORTRAN doth remain.

      --
      the more accurate the calculations became, the more the concepts tended to vanish into thin air. R. S. Mulliken
    10. Re:FORTAN programs are small right? by Anonymous Coward · · Score: 0

      I am sure most of these programs are small and maintained by a few people. So does it matter if it is ugly?

      Yes, in my experience it matters *more* in that case. If 10,000 developers know how the code works, and it's ugly, I can get find somebody who'll answer how it works for me. If 3 developers know how it works, chances are they've all moved on by now, and I'm SOL.

      Another reason why ugly code in a small program is bad: if they can't figure it out, and it's not very long, they'll just rewrite it. If it's a big program, they're much less likely to start from scratch, and instead refactor the program so it's more understandable.

      Ugly code is a liability anywhere, because it slows you down and limits your options.

    11. Re:FORTAN programs are small right? by StarsAreAlsoFire · · Score: 1

      I went to Uni at a very good school for aerospace. Most of the professors used either Matlab (it has its issues, but it isn't Fortran) or FORTRAN (it may be Fortran NOW, but they use FORTRAN;~).

      My first exposure to FORTRAN was a project where we were supposed to figure out what section of code needed to be modified to get a wing-lift calculation routine to work as-per-the assignment. Maybe a thousand lines of code in the section we were to focus on, and around 2K lines total. At this point I'd been working with Java in a paid position for about a year, so programming basics caused no issues.

      However, I made it to a section something like this (I don't remember the details exactly):

      100 if(lots of math = lots more math)
      goto 120
      110 evenMoreMath
      120 ugly code with no comments

      If you read through that code it isn't to bad. But think of the entire 70 char limit filled with equations relating to math you don't quite fully understand. The if statement filled two or three lines. It was BAD.

      About eighty lines and 4 hours later I found the 'goto 110' line that an experienced FORTRAN user would expect to find after reading that code.

      Needless to say, I hate FORTRAN with a passion now. Yes, the language, like any, is not at fault. But, since it is typically used in an engineering or scientific environment, FORTRAN is usually written by people who should never be allowed to program in the first place; people who are at once smart enough to write 4K lines of code using only three letter variable names, and yet somehow stupid enough to actually do it.

    12. Re:FORTAN programs are small right? by dbIII · · Score: 1
      several train simulators that use FORTRAN as a back-end for calculations

      As an aside, the rest of the simulator is written in VB
      now which would be easier to maintain? The fortran or the bastardized turbo pascal that is VB?
    13. Re:FORTAN programs are small right? by dbIII · · Score: 1
      FORTRAN is usually written by people who should never be allowed to program in the first place
      Here lies the problem - the programmers don't know remotelty enough mathematics to write the program and the mathematicians or engineers haven't been told how to write readable code - so the people who can do the job, albiet in an ugly way, write code. They can hand the programmer a few textbooks and a huge pile of papers, some probably pre-print, and wait a few months, or they can do it themselves.

      I think the author of the article really wanted to say "don't write code like a real engineer or scientist, write like a programmer". Comments about people learning fortran being forever contaminated in the article were childish, no matter who they were quoted from. You effectively have gotos in assembly.

      I think we should ingore the my langauge is better than yours crack in the article and just consider the rest.

    14. Re:FORTAN programs are small right? by gmletzkojr · · Score: 1

      It is actually easier to maintain the FORTRAN than the VB. Since no one understands the FORTRAN, no one changes it. The VB was written by the company, so the VB is open season.

      --
      I for one welcome our new [insert main topic] overlords.
    15. Re:FORTAN programs are small right? by slide-rule · · Score: 1

      I am sure most of these programs are small and maintained by a few people. So does it matter if it is ugly?

      Wrong on both counts. I am engineer (and code jock) in an aerospace company. I'm the person responsible (by default) of a behemoth code which we can only estimate has 1/4 of a million lines of code spread over hundreds of subroutines and include files (and which still calls out to other company-developed libraries)... and speaking in terms of computation effort, this code runs an analysis in a few minutes, whereas we have other codes that, collectively, take DAYS to run a full single analysis case for. (Here's where I wonder if I'm feeding a troll. Ah well.)

      As to the second point... HELL YES it matters the code is ugly. First, I'm not "young" by any modern standard, but a lot of deep voodoo in what I'm caretaker over is older than me, written by who knows how many people, across different OS platforms (and thus different language versions and vendor implementations of FORTRAN). Given the vintage, the early guys had to do some positively evil things to make the code work at all. The code remains ugly to this day simply b/c there's NO way a mountain of money large enough could ever be thrown at it to clean it up, and even if so, I'm personally doubtful a clean version would "work" properly. (Of course, this means the same input gives the same output we're calibrated against.) This creates a vicious cycle as new tricks the code has to do just make it uglier and less comprehensible.

      This is all common old-industry type stuff that designs a lot of things you all bet your lives on everyday. School does not (and cannot) prepare and engineering grad against this.

    16. Re:FORTAN programs are small right? by dbIII · · Score: 1
      It is actually easier to maintain the FORTRAN than the VB. Since no one understands the FORTRAN
      There are standards for fortran. It isn't pascal one day and java the next at the whim of microsoft like VB is. There is still a lot of fortran77 (that's the 1977 standard) being written today thanks to the g77 compiler. If you want to do a GUI front end today you do it in python, perl, php or whatever so you can access it with a web browser from any PC on the network. If you want to do serious matrix algebra the code is simpler and often faster in fortran than in C. If you want to do anything with text fortran is the last thing you would want to use.

      It comes down to what you are used to. Some people can write decent programs in postscript - point them at any langauge and give them enough time and they will produce decent code. Those are the sort of people that spot the bottlenecks and do them in assembler for several different platforms.

    17. Re:FORTAN programs are small right? by gmletzkojr · · Score: 1

      I certainly agree with what you've said. My comment about "No one understands the FORTRAN" was just that the people assigned to the project have a tough time reading the VB, so the chances at getting the FORTRAN are pretty slim ;)

      --
      I for one welcome our new [insert main topic] overlords.
  12. grampy by Fr05t · · Score: 0, Troll

    Oh no, my Grampy is going to shit bricks and go out on the war path when he sees this article posted!

    1. Re:grampy by jacen_sunstrider · · Score: 1

      Only old people in Korea code FORTRAN

    2. Re:grampy by Mattintosh · · Score: 1

      You know, if I shit bricks, I'd probably go on the war path too. Ouch...

  13. 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.
    1. Re:About time someone spoke up about Fortran. by Anonymous Coward · · Score: 0

      That's the most idiotic attempt at a troll post that I've seen in...well, the past five minutes really.

      If you're seeing more Fortan ads than Java ads in those classifieds, I'd suggest you get a newspaper older than say, the 1977 edition. Of course, the truth is that you're either outright lying or making a pathetic attempt at humour, so there's not much point in telling you that.

    2. Re:About time someone spoke up about Fortran. by Aardpig · · Score: 1

      I That's the most idiotic attempt at a troll post that I've seen in...well, the past five minutes really.

      The grandparent post was encrypted; decoding instructions here.

      --
      Tubal-Cain smokes the white owl.
    3. Re:About time someone spoke up about Fortran. by Anonymous Coward · · Score: 0

      uhm... I despise FORTRAN, but I'd take it over VB any day, for any computationally intensive application.

    4. Re:About time someone spoke up about Fortran. by Anonymous Coward · · Score: 0

      I was actually laughing out loud so hard my pepsi came out of my nose...

  14. Language is irrelevant by Anonymous Coward · · Score: 1, Funny

    Zen and the art of computer programming.

    Beginner: draws flowcharts
    Amateur: chooses languages, optimizes structures, types
    Pro: migrates types and structures across libraries, builds API's

    ZEN: Thinks of and designs nothing.

  15. 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.

    1. Re:FORTRAN considered useful...like SQL by vondo · · Score: 1

      Considering that FORTRAN pre-dates C by almost 15 years and was the first general purpose computer language, it's kind of a stretch to say it wasn't designed to be pretty. It was a lot prettier than the assembly of the time.

    2. Re:FORTRAN considered useful...like SQL by advocate_one · · Score: 1

      hmmm the first programs I ever wrote were in Fortran on punchcards... I had to submit a stack before 4pm in order for it to be run overnight... woe betide me if I got them in the wrong order, I had a simple trick to check quickly... When they were in the right order, I would write a couple of words on the top edge so I could check at a glance that the stack hadn't been shuffled as a prank... 1975, happy memories...

      --
      Donald 'Duck' Dunn: We had a band powerful enough to turn goat piss into gasoline.
    3. Re:FORTRAN considered useful...like SQL by Tablizer · · Score: 2, Informative

      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.

      Target market? Do you mean when IBM first designed it, or how it is actually used now? Most SQL "users" are developers. However, SQL is poorly suited for developers. Beyond a single SELECT statement, SQL's flaws start to pile up pretty quick. I think it is time to replace SQL with a better relational language. A RDBMS can perhaps use both SQL and the replacement so that non-techies can use the more English-like SQL if desired.

      Alternatives include Chris Date's "Tutorial D". I am also working on a replacement, tentatively called "Tops Query Language". However, I don't think they will catch on because SQL can fixed to be "good enough" if the industry is ever pushed to improve the situation.

    4. Re:FORTRAN considered useful...like SQL by jejones · · Score: 1

      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.

      More to the point, it was designed before people knew much about parsing and formal language theory...hence the cheesy ad hoc methods used to parse it, the fixed format, the Hollerith format item, and the infamous "DO 100 I = 1.10" problem.

    5. Re:FORTRAN considered useful...like SQL by Aardpig · · Score: 1

      and the infamous "DO 100 I = 1.10" problem.

      ...which isn't particularly infamous, when you realize that this problem never caused the demise of a spacecraft, unlike the urban legend would have us believe.

      --
      Tubal-Cain smokes the white owl.
    6. Re:FORTRAN considered useful...like SQL by Anonymous Coward · · Score: 0

      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.

      Are you proposing that a Ferrari has no use?

      When something is well-designed, it's both beautiful and utilitarian. They are not necessarily synonymous, but they're not exclusive, either.

      For example, take a look at Matlab (or Octave). Easy enough for just about anybody to type in a simple equation, powerful enough to do some very sophisticated things, and without all of FORTRAN's old crap. All of the numeric computation guys I've ever worked with use Matlab, not FORTRAN.

      If you want a more general-purpose programming language, take a look at Python with Numerical Python. (For at least one commercial game, Python was used not just by programmers, but by writers and artists and sound engineers. Beauty and utility.)

    7. Re:FORTRAN considered useful...like SQL by dillon_rinker · · Score: 1

      Do you mean when IBM first designed it, or how it is actually used now?

      I mean how it's marketed to business types. Sure, it's poorly suited for developers...but business types can use it. I have watched query and "business intelligence" tools come and go for almost 10 years, and SQL keeps on chugging.

      a better relational language
      Presumably by "better" you mean something like more powerful or more useful. Naturally this translates into something a comp sci major can grok but that makes an MBA's head explode. As far as they are concerned, SQL already IS good enough.

    8. Re:FORTRAN considered useful...like SQL by Tablizer · · Score: 1

      Presumably by "better" you mean something like more powerful or more useful. Naturally this translates into something a comp sci major can grok but that makes an MBA's head explode. As far as they are concerned, SQL already IS good enough.

      Yes. My pet query language is definitely targeted at developers, not PHB's. It would be more like comparing C or Java to COBOL. C and Java were never designed for PHB's, but COBOL was, at least at first. SQL's flaws are in some ways similar to COBOL's.

    9. Re:FORTRAN considered useful...like SQL by Mr.+Byaninch · · Score: 0
      I think the issue here (in this thread) is that it wasn't designed for coders. FORTRAN's whole gig was that scientists and mathmeticians could make a computer do their grunt work by explaining it to FORTRAN. FORmula TRANslator. Think science and math geeks.

      There wasn't any juxtaposition with assembler.

      The ugliness of FORTRAN (and, no, I never coded any, only read some to see if I wanted to learn it--didn't) is the point here. Real coders think it's ugly because it was designed for non-coders. And, IMHO, that's the point of the FORTRAN thread.

      --
      Sig not available, please try again later. If the problem persists, then the submitter is an idiot.
    10. Re:FORTRAN considered useful...like SQL by grips · · Score: 1

      Well, you were a lot more advanced than me, I used tilted lines (2 or 3 together), which did the same trick, on the carddecks for our Uni's IBM360/44... 1971, happy memories...

      --
      Knapp vorbei ist auch daneben.
  16. Old News by Stupidhead · · Score: 0

    In soviet russia, old people stopped writing FORTRAN in any language as soon as FIVETRAN came out.

    --
    Contributing to "Judgement Day" one line of
  17. I was looking forward to learning FORTRAN by Anonymous Coward · · Score: 0

    but all I could see was political bias about WMD and publicity for psychiatrists... sigh.

  18. It's not the language by Anonymous Coward · · Score: 0

    It's the programmer who's the problem. Most FORTRAN program are written by engineers and scientists that don't know how to design programs or write goodd code in any language. Many of these guys graduated to C/C++ and still write crappy code.

    You can write FORTRAN code that is transparent and easily maintained if you follow good design and coding practices.

  19. HEY /. !! Look at what we wrote!! by curtisk · · Score: 2, Insightful
    Cripes.

    So are they using "FORTRAN" as a adjective replacing "crappy" and then whipped up an article that has been covered in about 5,000 different programming books and/or documentation regarding some largely accepted guidelines for writing clean, manageable and efficient code?

    Why is this on the front page?

    "Acmqueue Click-thrus ACTIVATE!! Go Go Go!"

    --

    Sehr geehrter Toilettenbenutzer!

    1. Re:HEY /. !! Look at what we wrote!! by Greyfox · · Score: 1
      They're trying to push that late-nite cable tv advertisement for a sticker that "extends your cell phone battery's life" off the front page.

      It's not working very well...

      --

      I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

    2. Re:HEY /. !! Look at what we wrote!! by Anonymous Coward · · Score: 0

      Huh? Why is this comment modded offtopic. I've seen quite a few bizzare mods for this article. It's clearly arousing some strong passions!

    3. Re:HEY /. !! Look at what we wrote!! by Zen+Punk · · Score: 1

      This is most certainly on-topic. The moderation system just isn't worth it.

      --
      Sleep is futile.
  20. Even better... by GillBates0 · · Score: 2, Funny
    and more literal "DONT you Brainfuck with me".

    For the uninitiated, Brainfuck's a Turing Complete language with eight language statements, each consisting of a single character:

    > increment the pointer.
    + increment the byte at the pointer.
    - decrement the byte at the pointer.
    . output from the byte at the pointer (ASCII).
    , input to the byte at the pointer (ASCII)
    [ jump forward to the statement after the corresponding ] if the byte at the pointer is zero.
    ] jump back to the statement after the corresponding [ if the byte at the pointer is nonzero.

    I'd post actual code, but the /. filter is fucking me up.

    --
    An Indian-American Hindu committed to non-violent thought/speech/action alarmed by the global explosion of radical Islam
  21. 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
    2. Re:Article format by Anonymous Coward · · Score: 0

      We are changing our site to have the printer-friendly version all print out on one page. Sorry it's not yet ready! Next week we hope ;)

    3. Re:Article format by Anonymous Coward · · Score: 0

      Which makes one wonder: how long before some ad wizard comes up with the idea of putting ads in source code?

      Imagine Microsoft releasing Windows source code, but peppering with ads for smiley collections and "next page" links in the style of this article.

    4. Re:Article format by Rick+and+Roll · · Score: 1
      Oh, great. You actually came on here.

      What a useless article.

      I don't see why people have to bring so much bullshit to every discussion. This morning I had a class on Distributed Systems, and what it essentially came down to was Peer to Peer is great, but for some applications Client/Server is even better. Well, of course Client/Server is better for most things.

      People just seem to be in a mad rush to embrace new technique and technology, that they forget that most of the time, simple dedication and practicality will suffice.

      So I encourage you and your fellow programmers to get a life and realize that math professors who use FORTRAN are not harming anybody. In fact they are probably more productive and doing more interesting work than you are. There, I said it!

    5. Re:Article format by Zach+Garner · · Score: 1

      Oh, great. You actually came on here.

      What a useless article.

      I don't see why people have to bring so much bullshit to every discussion. This morning I had a class on Distributed Systems, and what it essentially came down to was Peer to Peer is great, but for some applications Client/Server is even better. Well, of course Client/Server is better for most things.

      People just seem to be in a mad rush to embrace new technique and technology, that they forget that most of the time, simple dedication and practicality will suffice.

      So I encourage you and your fellow programmers to get a life and realize that math professors who use FORTRAN are not harming anybody. In fact they are probably more productive and doing more interesting work than you are. There, I said it!

      Oh, great. You actually came on here.

      What a useless comment.

      I don't see why people have to bring so much bullshit to every discussion. This morning I read an comment on article topics, and what it essentially came down to was some article topics are great to some people, but for some people those articles aren't. Well, of course some articles aren't great for most people.

      People just seem to be in a mad rush to make comments about every new slashdot article, that they forget that most of the time, their opinion is both unimportant and expressed in a multitude of previous comments.

      So I encourage you and your fellow commenters to get a life and realize that article writers are not harming anybody. In fact they are probably more productive and doing more interesting work than you are. There, I said it!

    6. Re:Article format by frank_adrian314159 · · Score: 1

      It's all part of ACM's ongoing efforts to try to make their publications look as non-professional as possible. God knows no one wants to read magazines and/or websites with text on them anymore!

      --
      That is all.
  22. 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 curtisk · · Score: 1
      I'd have to say that it had the opposite effect for me, my eyes glazed over with a joyful sparkle. At that point I knew I had to see where they were going with it.

      But that being said I agree with your point, and I'm not a big Bush fan myself.

      --

      Sehr geehrter Toilettenbenutzer!

    2. Re:Was introducting Bush/WMDs really necessary? by Anonymous Coward · · Score: 0

      You're pretty touchy. I read it and it seemed pretty natural. I guess the right is so embarassed we can't even a talk about Bush and WMB. It's not like the code mentions lying to the American people or the goal being to invade and WMB being the excuse. 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.

    3. 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.

    4. Re:Was introducting Bush/WMDs really necessary? by biobogonics · · Score: 1

      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.

      *College student?* I wrote this kind of stuff back in *grade school* in 1962 in FORTRAN except back then it was JFK.

      _flame on_
      Considering the commercial, political and generally juvenile slide slashdot has taken lately, this is about par for the course.
      _flame off_

    5. 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
    6. Re:Was introducting Bush/WMDs really necessary? by Anonymous Coward · · Score: 0

      "...who has not matured much beyond that. How gauche."

      Gauche? Man, do you eat quiches?

    7. Re:Was introducting Bush/WMDs really necessary? by jejones · · Score: 1

      Maybe next time the author will be more politcally correct in his examples.

      On the contrary, he was quite politically correct; he gratuitously dragged leftist political views into a technical discussion.

      Come to think of it, maybe not. If he were really politically correct, he'd be writing about how elegance in coding and correctness of code is an imperialist concept foisted on us by Dead White European Males, and that programs are texts that have no inherent meaning.

    8. Re:Was introducting Bush/WMDs really necessary? by Macrobat · · Score: 1

      Yes, I find programming articles sprinkled with allusions to "Star Trek" or "Dr. Who" to be a much greater sign of maturity than mere contemporary references.

      --
      "Hardly used" will not fetch you a better price for your brain.
    9. Re:Was introducting Bush/WMDs really necessary? by ifwm · · Score: 1

      "Really, the only expression that should be forbidden is one written in FORTRAN."

      And yelling fire in a crowded theatre is a great idea, and should be encouraged.

      Amazing how you torpedoed a good point with an idiotic opinion.

    10. Re:Was introducting Bush/WMDs really necessary? by Anonymous Coward · · Score: 0

      Tough. eh? :)

    11. Re:Was introducting Bush/WMDs really necessary? by Daniel+Dvorkin · · Score: 1

      PC is a disease that infects both Left and Right; it may please right-wingers to pretend otherwise, but that's the way it is. F'rinstance, it's terribly PC for people who never had the guts to join the service themselves to go on loudly about how they "support the troops."

      --
      The correlation between ignorance of statistics and using "correlation is not causation" as an argument is close to 1.
    12. Re:Was introducting Bush/WMDs really necessary? by Brandybuck · · Score: 1

      PC is a disease that infects both Left and Right; it may please right-wingers to pretend otherwise, but that's the way it is.

      Not at all. While a tiny bit of PC infects all of us, it is only the left that elevates it to such an important position. If you tell a dirty joke to a white Baptist living in Alabama, you will be met with scorn and ostracism. If you tell the same dirty joke to a black feminist living in Berkeley, you will find your financial status in serious jeopardy as you are dragged through a lawsuit. If it happened at your workplace, you could lose your job.

      I am a libertarian with anarcho-capitalist leanings. As such, I am politically incorrect to both the left and the right. Yet I can have a discussion about drug legalization with the right. Yet a discussion about the eliminating of taxation will not occur. They will not discuss this with you. I know this from experience. Both the left and the right think I'm wrong, but only the right respects my difference of opinion. The phrase "we must agree to disagree" will never be uttered by the left.

      --
      Don't blame me, I didn't vote for either of them!
    13. Re:Was introducting Bush/WMDs really necessary? by Brandybuck · · Score: 1

      Yet a discussion about the eliminating of taxation will not occur.

      Sorry, I meant to include "with the left" in that sentence.

      p.s. Of course, I don't mean everyone on the left (or the right). But having lived in both bright red and bright blue counties, I know that the generalization is reasonably accurate.

      --
      Don't blame me, I didn't vote for either of them!
    14. Re:Was introducting Bush/WMDs really necessary? by Anonymous Coward · · Score: 0

      How come Prez Bush be bombin' da Kurdz wit doze BLTs??

      Do we really be needin' to kill for sand witchez?

      Booyakasha!

    15. Re:Was introducting Bush/WMDs really necessary? by Anonymous Coward · · Score: 0

      "Really, the only expression that should be forbidden is one written in FORTRAN."

      And yelling fire in a crowded theatre is a great idea, and should be encouraged.

      Amazing how you torpedoed a good point with an idiotic opinion.


      Uh, that's pretty obviously a joke.

    16. Re:Was introducting Bush/WMDs really necessary? by gardyloo · · Score: 1

      How gauche

      Perhaps. But it's BSD compliant! :) http://www.shiro.dreamhost.com/scheme/gauche/index .html

    17. Re:Was introducting Bush/WMDs really necessary? by Bob+Uhl · · Score: 1
      But that's the thing: it's not an historical fact: the WMDs were not a figment of Bush's imagination, but a figment of the global intelligence community's imagination (they were also not the sole reason we went to war, but that's another issue entirely). No-one believed that Hussein lacked WMDs: the disagreement was on what to do about them.

      It was pointless and puerile.

    18. Re:Was introducting Bush/WMDs really necessary? by Hatta · · Score: 1

      No-one believed that Hussein lacked WMDs: the disagreement was on what to do about them.

      I didn't. The weapons inspectors Bush kicked out of Iraq didn't. The evidence for WMDs was dubious (aluminum tubes, etc), and not accepted by many in the intelligence community. Bush and Co. deliberately chose to only listen to the minority that supported their viewpoint. And then they put more spin on it, even ignoring specific instructions by technical advisors that certain statments were not true.

      --
      Give me Classic Slashdot or give me death!
    19. Re:Was introducting Bush/WMDs really necessary? by Hatta · · Score: 1

      I am a libertarian with anarcho-capitalist leanings....Yet I can have a discussion about drug legalization

      Anarcho-capitalist? So it's not ok for the government to prohibit drugs, but it's just fine for your employer to? I fail to see how that results in any more freedom except for the independantly wealthy.

      --
      Give me Classic Slashdot or give me death!
    20. Re:Was introducting Bush/WMDs really necessary? by Kiryat+Malachi · · Score: 1

      Bush also believed they existed, meaning that the statement is true - they were *also* a figment of Bush's imagination.

      --

      ---
      Mod me down, you fucking twits. Go ahead. I dare you.
      (I read with sigs off.)
    21. Re:Was introducting Bush/WMDs really necessary? by Geoff-with-a-G · · Score: 1

      Calling someone a jackass for inserting a political jab into a programming language article isn't censorship.

      "We need to be able to talk about issues, in any manner we like, without fear of reprisal."

      Reprisal from who? If I go into a movie theater and start ranting about Microsoft business policies in the middle of a movie, there will probably be angry reprisals from the audience and the theater management. If I say something tremendously insulting to someone I care about, I will probably see "reprisals" from it.

      This isn't about free speech being censored by the evil forces of political correctness. This is one citizen doing something crass and dumb, and another citizen calling him on it.

    22. Re:Was introducting Bush/WMDs really necessary? by FungiFromYuggoth · · Score: 1

      Here's the thing - you're wrong. You're certain (certain enough to post this in multiple boards!) but you're still wrong.

      "Everyone" did not believe that - Iraq certainly didn't believe it. They wrote a ten thousand page document that was mocked at the time, but is now considered the best documentation of what happened to Iraq's WMDs.

      Scott Ritter didn't believe it. He was derided for "Drinking Saddam's Koolaid". I kind of think an intelligent, professional, conservative former weapons inspector saying that there was no proof Saddam had WMD invalidates your whole argument - but there's more!

      Hans Blix was skeptical, because the US's intelligence tips weren't panning out. Do you remember the mockery the US piled on the "Clouseau-esque" weapons inspectors, who were never able to find evidence that Saddam was lying about having destroyed those weapons?

      The French, if you'll check, were willing to come in with us if the US were willing to let the inspections work first. It wasn't.

      The argument is particularly stupid when you step back a moment and say, "Why did 'the world' believe that Saddam still had WMDs?" Because the US told them! Most governments did not have intelligence assets inside Iraq. The phenomenon you're talking to was not global, and

      (The difference between "sole reason" and "primary reason" is left an exercise for the student, as homework for Straw Men 101.)

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

      I don't see any reason to stay off a historical fact just because it made someone look stupid.

      Me neither. There is a reason to avoid it, though, if it is irrelevant, stupid, and politically motivated.

      Surely there are dozens of political facts other than this case that can be made into an analogy with Fortran. Surely there are hundreds of historical non-political such facts. Surely there are thousands of non-historical, computer-related facts that he could've used to draw a reasonable, on-topic analogy.

      He didn't mention the WMDs onle because it just happened to fit his story, did he?

    24. Re:Was introducting Bush/WMDs really necessary? by Anonymous Coward · · Score: 0

      Overall, I was pretty bored with the article until it got to that point.. then I was just slightly annoyed by the stupidity of bringing a personal political issue into the middle of a technical discussion.
      Funny tagline for the article, but completely lacking in useful content, IMHO.

    25. Re:Was introducting Bush/WMDs really necessary? by FungiFromYuggoth · · Score: 1

      Here's the thing - not only can the Right stop people from talking about Social Security "privatization", they can orchestrate a lockstep switch in the media from "private accounts" to "personal accounts", and claim that it's pure liberal bias not to use only the current Republican talking points. If you are having a discussion about completely eliminating taxation, no one will take you seriously. The Right is trying to minimize taxation on them, but I kind of doubt they're going to be giving up cops, troops, or corporate (and pundit!) welfare anytime soon. I think you may be confusing political correctness with adolescence.

    26. Re:Was introducting Bush/WMDs really necessary? by Brandybuck · · Score: 1

      If you are having a discussion about completely eliminating taxation, no one will take you seriously.

      They may not take the prospects of it every happening seriously (I myself don't), and they may have problems with the underlying premises of my argument, but the right, in general, will take ME seriously. They will not say "shut up you sound like an adolescent", but will genuinely listen to my arguments (and then patiently try to explain to be why I'm wrong). They may not take the idea itself seriously, but they certainly do take diversity of ideas seriously.

      People may laugh at that last point, but it is true in my experience. If it doesn't look like you're arguing just to start a fight, and it doesn't appear you're arguing verbatum from some flyer you found at Whole Foods, then most people on the ideological right will genuinely respect you for your beliefs.

      --
      Don't blame me, I didn't vote for either of them!
    27. Re:Was introducting Bush/WMDs really necessary? by Brandybuck · · Score: 1

      I only "tend" towards anarcho-capitalism. Besides, since my post was not advocating anarcho-capitalism, and merely mentioned it, the fact that you took such great offense at my anarcho-capitalist tendencies seems to validate my point.

      --
      Don't blame me, I didn't vote for either of them!
    28. Re:Was introducting Bush/WMDs really necessary? by Hatta · · Score: 1

      Offence? Not really. I'm just always interested to see how people justify seemingly obvious contradictions like that. I could be wrong but the employer/employee relationship seems like a de facto government to me. Besides, I was trying to start a discussion, not avoid one. Frankly, I think disagreements are fun.

      --
      Give me Classic Slashdot or give me death!
    29. Re:Was introducting Bush/WMDs really necessary? by Brandybuck · · Score: 1

      I'm just always interested to see how people justify seemingly obvious contradictions like that.

      The difference is coercive force. You must obey the government, but your relation with your employer is voluntary. If you don't like your employer, you can find another. But if you don't like your government, tough luck!

      Some may argue that employers use economic coercion, but anarcho-capitalists dismiss this as socialist myth. It might seem sometimes that we are slaves to our employers, but in reality we are not. The options open to use for employment are many and varied. We can find another job. We can start our own business. We can reduce our economic lifestyle and be unemployed or retire early. Contrast that to the government, where the only choices you are given are to obey or be imprisoned.

      --
      Don't blame me, I didn't vote for either of them!
    30. Re:Was introducting Bush/WMDs really necessary? by jejones · · Score: 1

      So it's not ok for the government to prohibit drugs, but it's just fine for your employer to?

      Yes, for exactly the same reason that you can choose who you do business with on whatever basis you wish, be it reading Consumer Reports, or deciding that some company's ads are irritating or offensive or that you don't care for some aspect of their behavior.

    31. Re:Was introducting Bush/WMDs really necessary? by Anonymous Coward · · Score: 0

      > This isn't about free speech being censored by the evil forces of political correctness. This is one citizen doing something crass and dumb, and another citizen calling him on it.

      Funny, I thought exactly the same thing.

      Oh, you weren't talking about TFA?

    32. Re:Was introducting Bush/WMDs really necessary? by Anonymous Coward · · Score: 0

      Dude:

      Fortran was first mentioned in the THIRD sentence!

      So where did you learn to read? WalMart? Looks like that's where you got your brains!

      Me

  23. Basic is beautiful? by rigelstar · · Score: 1

    10 clear
    20 print "hello world"
    30 goto 20

    1. Re:Basic is beautiful? by mrtroy · · Score: 1

      My high school teacher who taught me basic said to me

      "You already know way more than me about programming! I am sure you will do way more programming than me in your life"

      He was right! He died shortly afterwords.

      --
      [I can picture a world without war, without hate. I can picture us attacking that world, because they'd never expect it]
  24. 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.

  25. Not Brainfuck by PornMaster · · Score: 1

    You can't write "good" Brainfuck.

    http://en.wikipedia.org/wiki/Brainfuck

    1. Re:Not Brainfuck by BlowChunx · · Score: 1

      ..or befunge

    2. Re:Not Brainfuck by Anonymous Coward · · Score: 0

      ...or malbolge

  26. 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.
    1. Re:A great programming language by seminumerical · · Score: 2, Informative
      I loved the fact that everything was pass by reference

      Actually, FORTRAN IV, on some computers of the day (I think IBM 360/370 using FORTRAN's G or H), used pass by "value and result" rather than pass by reference. There were so many differences amongst the dozens of dialects of FORTRAN out there in my day (late 70's) that portability was nonexistent and I changed languages.

      --
      In wartime... truth is so precious that she should always be attended by a bodyguard of lies. (Churchill)
    2. Re:A great programming language by hisstory+student · · Score: 1

      Exactly! My favorite programming tricks of all time involved the use of EQUIVALENCE. Stuff that would drive you nuts in any other language.

      --
      Heard any good sigs lately?
    3. Re:A great programming language by Anonymous Coward · · Score: 0

      Pass by value for scalars, pass by reference for arrays. And try a named common /MAIN/, store code in it and execute away. Ahh, the 360, what fun ;-)

    4. Re:A great programming language by cburley · · Score: 1
      My favorite programming tricks of all time involved the use of EQUIVALENCE.

      Not just your favorite; the PRIMOS operating system, and many of its utilities (I started out fixing bugs in FUTIL, the file-utility program that did copying, deleting, renaming, etc. of files), used EQUIVALENCE, as they were written in a kind of FORTRAN 66, along with COMMON, to do what C programmers would ultimately recognize as structs, unions, pointer operations, malloc()'s, and free()'s.

      I'm not making this up.

      --
      Practice random senselessness and act kind of beautiful.
  27. FORTRAN 77 by jdtanner · · Score: 1

    I've just spent the past two weeks leaning how to program in FORTRAN77 (hereafter F77). Why you might ask? Well, I'm a PhD student and most of the code that my supervisor has 'gifted' to me is in F77.

    What do I think of F77? Well, I was very surprised how quickly you can get stuff done. Sure, sticking to the fixed format (a relic of punchcards) is a bit of a pain, but you quickly get used to it. I'm currently using a mix of g77 and the Intel F77 compilers (depending of the processor), and the compile time on reasonably complicated programs doesn't leave me twiddling my thunbs for too long.

    I think that as long as you comment your code, and make sure that you have thought about what you want to do before you do it (!), then you can write very efficient code in F77.

    Cheers,
    John

  28. First programming language by KillerEggRoll · · Score: 1

    FORTRAN 77 was my first programming language. I learned it during a high school mentorship program at NASA LaRC. I remember the coworkers of my mentor stating "Wow, you really hate this kid!"

  29. FORTRAN is still huge in Astronomy by Globby · · Score: 1

    We have huge amounts of FORTRAN 77 (and lesser amounts of Fortran 90) code flying around on our servers. It handles big arrays of numbers (which is all astronomical images are) very well. We're forced to actually buy compilers for the f90/f95 stuff...

  30. 6502 Assembly is pretty: by Anonymous Coward · · Score: 0

    Now just figure out which platform runs this code the right way and win a Devil Duckie Flash Drive.

    300:LDA $C030
    303:JSR $FDED
    305:JMP $0300

    1. Re:6502 Assembly is pretty: by pommiekiwifruit · · Score: 1
      Translated:
      loop:
      lda speaker
      jsr cout
      jmp loop

      And you need to run it on a computer created by some guy called "Rocky Clark".

    2. Re:6502 Assembly is pretty: by headkase · · Score: 1

      ...300:LDA $C030...
      The A, X, and Y registers on the 6502 are eight bit, so the maximum value you'd be able to load is:
      LDA #$FF
      The platform for that code is probably C64 as the jump table was stored right at the high end of memory. But the Apple II's also used a 6502 so it could be them too.

      --
      Shh.
    3. Re:6502 Assembly is pretty: by Anonymous Coward · · Score: 0

      Uh, is that a Commodore Kernal entry point? FDED??

    4. Re:6502 Assembly is pretty: by Anonymous Coward · · Score: 0

      Mmm, doesn't LDA $C030 load the byte at the address $c030?

    5. Re:6502 Assembly is pretty: by headkase · · Score: 1

      Yeah it might, I was thinking about that after I posted.

      --
      Shh.
    6. Re:6502 Assembly is pretty: by schon · · Score: 1

      The A, X, and Y registers on the 6502 are eight bit, so the maximum value you'd be able to load is:
      LDA #$FF


      Note he didn't specify LDA #$C030, he specified LDA $C030 - load the value from location $C030 into accumulator.

      The platform for that code is probably C64 as the jump table was stored right at the high end of memory.

      It's not for the C64 - if it's a useful program, $C030 is part of an 8K RAM bank, and $FDED isn't an official kernal entry point (it's been awhile since I took a look at the kernal disassembly, so I couln't tell you if it actually a valid address for jumping to, but I doubt it.) So, if it was a useful program, he'd be taking a value that doesn't change, and passing it to a fixed routine.

    7. Re:6502 Assembly is pretty: by pommiekiwifruit · · Score: 1
      Most 6502 systems (NES, Apple 2, C64, Vic-20, Pet) will have kernel ROM at the top of memory, because that is where the reset vector is! Similarly a z80 (spectrum) would have rom at the bottom, since that is where it starts execution.

      That particular program looks like it would make a tone and print crap on the screen of an Apple 2.

      To test that, run an apple 2 emulator. According to the internet, type the following lines:
      call -151
      !
      0300:lda C030
      0303:jsr fded
      0306:jmp 0300

      0300G

      Note that I corrected the bug :-)

      And as I predicted, crap fills up the screen with characters scrolling past (isn't the internet wonderful?)

    8. Re:6502 Assembly is pretty: by Anonymous Coward · · Score: 0

      I ran it on my Atari 800 emulator and got a screenfull of
      "All your base are belong to us"

    9. Re:6502 Assembly is pretty: by pintpusher · · Score: 1

      urrrhhhh brain hurts. too...far ... in past ... to re..mem...ber

      Here's some nit-picky crap but wasn't the C64 6510 and Vic20 6502? oh gawd I'm outed. I actually had both of them for a while.

      Can't remember... if not, then what was the 6510? was that apple ][e ??

      oh well. it gone now.

      killed that brain cell years ago.

      --
      man, I feel like mold.
    10. Re:6502 Assembly is pretty: by pommiekiwifruit · · Score: 1
      Well the C64 used a 6510, which was just a 6502 with a couple of bank switching registers added at locations 0 and 1.

      The NES used a 2A03
      which is a 6502 with the decimal mode not working, and some sound registers added.

      I think the BBC, VIC-20 and Apple 2 were plain jane 6502s, but some later models might have used the 65C02.

      IIRC lots of optomechanical PC mice used a SunPlus 8 bit chip which was a cut-down 6502.

  31. And assembly is pretty? by Infinityis · · Score: 2, Interesting

    So what if Fortran is ugly--all languages get uglier the less they are used and the more high-level languages are developed. I'm sure lots of people would look at assembly code and say it's ugly too. It's only a matter of time before our kids look at C++ code and say, "Boy, am I glad I didn't have to program like that!".

    Kinda reminds me of "Back to the Future III" where Marty plays that shoot-em-up arcade game in front of kids, and all they can do is complain "You mean you have to use your hands. That's like a baby's toy."

    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.

    1. 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
    2. Re:And assembly is pretty? by soft_guy · · Score: 1

      Think of the app you want, then push the button and out pops the app.

      That pretty much works today if all you ever think of is "Silly Balls".

      --
      Avoid Missing Ball for High Score
    3. Re:And assembly is pretty? by Anonymous Coward · · Score: 0
      It's only a matter of time before our kids look at C++ code and say, "Boy, am I glad I didn't have to program like that!".

      I'm not a kid, but when I look at c++ code I think "Boy, am I glad I don't have to program like that!" I like plain C though and oop is second nature to me, but c++ just feels... wrong.

    4. Re:And assembly is pretty? by Anonymous Coward · · Score: 0

      He used the word "think", so that rules out management.

    5. Re:And assembly is pretty? by KevinIsOwn · · Score: 1

      And the end user as well.

    6. Re:And assembly is pretty? by typhatix- · · Score: 1

      When someone says ``I want a programming language in which I need only say what I wish done,'' give him a lollipop.
      -- Alan Perlis

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

  33. First experience with Fortran by joshv · · Score: 1

    It took me 2 hours to compile my first simple Fortran program, because I didn't realize that the first 5 columns were off limits. That's where the line numbers used to be on the punch cards.

    Why this limitation persisted into a verion of Fortran that no longer even required line numbers - no idea.

    1. Re:First experience with Fortran by vondo · · Score: 1
      Why this limitation persisted into a verion of Fortran that no longer even required line numbers - no idea. Because a lot of this code got dumped onto disks and is still used today. Actually I don't know that line numbers were ever required, just often put in so you could re-assemble your cards if you dropped them.

      The limitation of 72 characters come from this too. Line numbers or sequence numbers were often put in columns 73-80. If compiliers started paying attention to what was in those columns, lots of code would break.

    2. Re:First experience with Fortran by rnturn · · Score: 1

      ``Actually I don't know that line numbers were ever required, just often put in so you could re-assemble your cards if you dropped them.''

      If anyone used them to aid in reordering their dropped card deck, they were nuts.

      I remember the IBM editors (this back in the early '80s before I shifted over to DEC systems) would put the sequence numbers into columns 73-80 automatically. And that was past the days when anyone actually used cards. The IBM editors could use those numbers for commands to insert/delete lines and some of the system tools would let you modify files (sort of like "patch") by inserting into or deleting from a source file based on those sequence numbers.

      Once we found out that they weren't required, though, we found ways to prevent the editor from inserting them or ran CMS EXECs on the source files to strip them off just so that compressing our source files would save even more disk space. (An important thing to know back when a typical disk allocation on an IBM supermini was something like a couple of megabytes.)

      --
      CUR ALLOC 20195.....5804M
    3. Re:First experience with Fortran by Anonymous Coward · · Score: 0

      I'll admit to being nuts. It's much better to have a deck sequence numbered when the operator at a big 360 site does a floor sort on your submitted job than to not have it sequenced. Same goes for data decks. Oh, wait, I forgot cards don't exist anymore.

      And I once wrote a C compiler in COBOL, so there.

    4. Re:First experience with Fortran by Anonymous Coward · · Score: 0

      I was distinguishing line numbers (as in "GOTO 100" or similar) to the sequence numbers that were out in columns 73-80. And sequence numbers were, as I recall, only found on IBM systems. I cannot remember seeing anything like a sequence number on any DEC system I programmed on. (Or even the ancient Sperry/Univac with FORTRAN V and ASCII FORTRAN. I rather liked their FORTRAN but, ugh, an awful OS.)

  34. 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.

    1. Re:Why use FORTRAN these days? by rebelcool · · Score: 2, Informative

      Alot of it has to do with legacy scientific and engineering libraries. There are millions of lines of proven libraries that were originally written in the 60s and 70s for various scientific and engineering analysis disciplines.

      When I was at the university of texas, there was a parallel programming course that was conducted in fortran and c++. The professor of it quoted how much it would cost in labor and manhours to transfer all those fortran libraries to a more "modern" language - and it was many many millions of dollars and years of work. So, the course taught parallel programming by having students doing this work! It was fairly successful, and is probably still taught. The converted libraries generated by students are in use in several fields. It was alot of parallel linear algebra libraries, IIRC.

      --

      -

    2. Re:Why use FORTRAN these days? by asuffield · · Score: 1

      Since major companies like IBM have chosen to produce compilers that perform best with FORTRAN.

      It's not a choice. Fortran is easier to compile efficiently in a number of respects, that's all. Notably, it doesn't have anywhere near the amount of trouble that C compilers do with pointer aliasing, which can make a significant difference for scientific code.

      That's not to say that fortran is a good language. However, we still don't have any more modern language that does any better in this respect, which is kinda pathetic really.

    3. Re:Why use FORTRAN these days? by francisew · · Score: 1

      There is one thing that FORTRAN does much more nicely than most of the other high-level languages that I use: array indexing is really straight forward. It's easy to index slices of an array.

      I don't really like the overall look or feel, but it does the job really well.

      I think that far too many people assume that it's obsolete and completely useless. I used to ignorantly assume that it was some kind of dead languages that was completely obsolete. I'm happy that I finally realized otherwise.

    4. Re:Why use FORTRAN these days? by sparkz · · Score: 1

      I'll take one of those dual-process 8086 machines, if you've got a spare one :-)

      --
      Author, Shell Scripting : Expert Re
    5. Re:Why use FORTRAN these days? by Anonymous Coward · · Score: 0

      You do know that recent x86 cpu's have fairly decent simd units as well? AMD64 isn't too bad runnning in 64-bit mode.
      Yup, I'd still prefer something riscy with a lot more registers, but it's not like that's ever going to happen. Maybe cell could do it if ps3 drives the prices low enough, but I really don't know a lot about that architecture.

  35. Fishing for a response by eltoyoboyo · · Score: 1

    ...although many programming languages have features superior to Fortran in various ways, it is by no means obvious that any language is sufficiently better than Fortran to justify making the switch. In fact, the ways many things are done in Fortran are now recognized as being superior to that of many other programming languages. One example involves the methods used to create and access global data. For a few years, the Algol/Pascal method involving block structure was considered superior, but now computer scientists think the Fortran model, particularly with the Fortran 90 module feature, is better.

    Fortran 90 Handbook Complete ANSI / ISO Reference
    Jeanne C. Adams, Walter S. Brainerd, Jeanne T. Martin, Brian T. Smith, Jerrold L. Wagener


    This is a Tr0ll story on the order of "GPL licensed software saves Tsunami victims." The FA really does not even comment on the merits or problems of Fortran syntax. It could just as well have read How not program Assembly In Any Language....

    I have seen better Ruby vs Perl vs Python gripefests....

    --
    Have you Meta Moderated t
  36. Xenophobia by ClosedSource · · Score: 0, Flamebait

    I think naming conventions and style conventions are more about compulsiveness and xenophobia than they are about comprehensiveness or maintainability.

    It's not that you can't understand This_Is_A_Big_Name when you're used to ThisIsABigName, it just that it disturbs and annoys you.

    1. Re:Xenophobia by Anonymous Coward · · Score: 0

      Absolutely It's Like Reading A Sentence Written By Someone Who Capitalizes Every Letter And Runs On Without Any Punctuation At All.

      Personally I find Java's cutesyPooCapitalizationRules very annoying.
      Hashtable and HashMap indeed.

    2. Re:Xenophobia by ClosedSource · · Score: 1

      "Personally I find Java's cutesyPooCapitalizationRules very annoying.
      Hashtable and HashMap indeed."

      I don't know much about Java's naming conventions. Was your intent to show that they are inconsistently applied? That's common practice with most naming conventions. Any set of rules that aren't enfoced by the compiler aren't going to get followed very well.

      Also in my experience, a lot of productivity is sucked up by convention hard-cases, who feel the need to "correct" non-compliant code when they could be chasing down real functional defects.

  37. FORTRAN takes me back to when... by Anonymous Coward · · Score: 0

    My first programming experience (of any sort) was on FORTRAN a few years ago. I did not particulalry enjoy the experience. Sure, for mathematical calculations, it is light, fast, and efficient, but if you want to actually do something with it...forget it. I think I finally threw my hands in the air and quit when it came to doing nested "do" loops that sought elements from an array, manipulated them, and printed them out to a CSV sheet for later manipulation in Excel.

  38. Palestinian Liberation? by gracenix · · Score: 0

    FORTRAN used as new recruiting language.

  39. Too true, and it's even more fun to teach to noobs by Anonymous Coward · · Score: 0
    Maintainability is first and foremost in any code that has to survive more than a few days or weeks.

    Teaching this to noobs straight out of college with their oh-so-shiny C++ programming degree is too fun, and it's easy, too.

    Just give them any assignment where you know they'll have to make changes to any code they write. Once they get it working, give them the new requirements. Repeat about three times, then call them into the office and ask them if they still think following good coding practices is something they're too smart to have to do....

  40. Fortran >=90 is nice and easy to learn by poszi · · Score: 2, Informative

    While Fortran 77 is ugly and I saw terrible programs written in Fortran 77, Fortran 90 or 95 is a pretty modern and nice language and if you know C, it is easy to learn Fortran 90. It is not that much different from anything else. It is great in numerical programs (especially linear algebra) as the matrix handling is nice and fast. The only problem is that only recently free (as in speech) Fortran 90 compilers has become available and they are still in beta stage. However, for Linux, Intel Fortan Compiler is free (as in beer) and works fine. It includes also documentation of the language so you may try it.

    --

    Save the bandwidth. Don't use sigs!

  41. QOTD by pete-classic · · Score: 2, Funny

    Heh. The quote of the day at the bottom of slasdot was somthing like "HONK USE IF THEN" earlier this morning.

    -Peter

    1. Re:QOTD by Anonymous Coward · · Score: 0

      Um, that would be
      "FORTH USE IF HONK THEN"
      extra lines
      are here
      so the lameness
      filter will
      go away

    2. Re:QOTD by pete-classic · · Score: 0, Offtopic

      Fuck. We're both off topic.

      -Peter

  42. Fortran is still a big deal in scientific apps by dingbatdr · · Score: 1

    I write very complex codes that solve partial differntial equations for science applications. We use fortran all the time for our core routines. All the data choreography is done in C++ but when you really need an array operation done quickly (and portably), nothing works better than Fortran. We have done tests comparing Fortran array operations to similar code written in c, and at one point the performance difference on the big iron was a factor of 7 (I doubt that it is still that high since most supercomputers now have commodity processors).

    Mixed language programming is a pain in the neck and we would get rid of it if we could. As of now, we can't.

    --
    The truth is an offense, but not a sin.------R. N. Marley
  43. 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

  44. How not to write irritating articles on the Web by Anonymous Coward · · Score: 0, Offtopic
    Don't spread your freakin' article over five "pages"!

    The whole idea of hypertext is that you have documents brought together by links. You use links to make connections to related works on your site or others. But it is not useful to break up a single short document artificially into "pages", as if it were a print publication, and link them together.

    Using "pages" decreases the chance that a person will actually read what you have to say. Worse, when your server is under load, using "pages" may decrease the chance that they are able to read it: if they load the first page and then go to get the second, it takes some time (which is, remember, money -- the reader's property, not yours!) and it may time out. Breaking the article into pages makes it less efficient for both your server and the reader.

    Whenever I see an article broken into "pages" I immediately conclude that one of those shithead "Web designers" has got their filthy paws all over the site. These are drooling morons who flunked design school (or went to a design school that should itself be flunked) and know nothing about usability. They spew useless huge graphics all over and use pointless techno-cruft like Flash. (The only site that should be allowed to use Flash is Homestar Runner.) Like apes driven mad they smear feces all over what would be a perfectly good work, rendering it sickening to handle or even to be near.

    There's no excuse for "Web design", and no excuse for wrecking a perfectly good article like this.

    1. Re:How not to write irritating articles on the Web by Anonymous Coward · · Score: 2, Insightful

      ...except that each time a page loads, a new set of ads is displayed, potentially making it more profitable for the author.

      So the artificial 'page' breaks are a byproduct of profit motive, nothing more.

      Sad, but true.

    2. Re:How not to write irritating articles on the Web by Anonymous Coward · · Score: 0

      There IS a use for splitting an article into multiple pages... more pageviews -> more advertising possibilities.

    3. Re:How not to write irritating articles on the Web by Anonymous Coward · · Score: 0

      Ditto the other two comments, but also, it increases your hit counts that you can claim to potential advertisers.

    4. Re:How not to write irritating articles on the Web by Pxtl · · Score: 1

      Then just embed banners into the articles at evenly spaced intervals.

  45. Finally Vindicated by joshuao3 · · Score: 1

    It's nice to see another coder who, in essense, styles code like I do. Namely:

    - Using underscores in variable names
    - Comment in real language when tricky stuff is happening
    - Don't over comment code
    - Use long variable names to enhance understanding
    - Liberal use of whitespace and indenting to block off lines accomplishing a task.

    I'm especially pleased about the underscores in the variable names. I can't stand CaseDeliniatedVariableNames. :-)

    --
    Monitor bandwidth usage on IIS6 in real-time: http://www.waetech.com/services/iisbm/
    1. Re:Finally Vindicated by Beardo+the+Bearded · · Score: 1

      I'm the same way - I like to use some_clear_name rather than SomeClearName for my variables.

      I'd say that my code is about 50% comments.

      Of course, I have to set a good example since I'm the lead software guy. ;)

      --

      ---
      ECHELON is a government program to find words like bomb, jihad, plutonium, assassinate, and anarchy.
    2. Re:Finally Vindicated by joshuao3 · · Score: 1

      50% seems like an awful lot of commenting. Most of mine are something like this:

      if (something)
      {
      // this branch has been reached because the user
      // selected this or that. We need to accomplish
      // the following steps...

      // 1. do this
      // 2. do that (be care of that over there)
      // 3. do this too

      // step 1. do this
      code();
      code1();
      loop1 {
      yep;
      we're;
      doing;
      something;
      now!;
      }
      code2();

      // step 2. do that
      // we need to do this, do that, and do these
      // to complete this step

      // step 2.1.
      code();
      code() {
      blah();
      foo();
      bar();
      }
      code();

      etc...;
      }

      You get the point. The ratio ends up being about 4:1 code to comments when all is said and done, so about 20% comments.

      --
      Monitor bandwidth usage on IIS6 in real-time: http://www.waetech.com/services/iisbm/
    3. Re:Finally Vindicated by FriedTurkey · · Score: 1

      It doesn't matter if your code is 0% or a 100% comments. The next developer is going to complain about the documentation. :-)

    4. Re:Finally Vindicated by Anonymous Coward · · Score: 0

      Umm not to nitpick... but 4:1 is 25% comments...

      so is it 25% or 5:1?

    5. Re:Finally Vindicated by rnturn · · Score: 1

      A recent "stupid code comment" story: I recently inherited a shell script from a departing consultant that contained the following:

      # Add one to count
      count=`expr $count + 1`

      The worst of it, though, was that a few lines later he wrote:

      if [ count -le 5 ]; then

      Now I get to tell his former employers that, maybe we should go over all the stuff he wrote.

      Speaking of silly "increment counter" comments... Does anyone remember when SuperSoft's FORTRAN compiler for PC-DOS came out? You know, the one with the INCREMENT statement? (Because, you know, having to code "I = I + 1" is just so difficult.)

      I jumped for joy when I moved out of the IBM supermini arena and moved to VAXes. Being able to use FORTRAN variables longer than 6 characters, allowed underscores in variables, actual tabs for indenting, actual CHARACTER arrays (no more using EQUIVALANCEs to LOGICAL*1 arrays), etc. It was like going to heaven (well, at the time it seemed so). Even though the older IBM code would still compile and run, I found myself "porting" much of it to VAX FORTRAN as I was making mods to it just to make is easier to read.

      The article's comments on whitespace were funny to. Contrary to the author, though, I do prefer that there be some sort of style manual for programmers to follow. Years ago, a coworker of mine wrote a ton of FORTRAN using statements like the following:

      DO10I=1,100

      just because the compiler would accept it (and he claimed he was saving disk space, as well). And he refused to use CONTINUE statements to terminate his DO loops. Let me tell ya, it was no picnic reading through his code and find out where loops started and ended. It wasn't uncommon to find that he had three or four DO loops all ending on the same statement.

      --
      CUR ALLOC 20195.....5804M
  46. Fortran vs. SQL by brlewis · · Score: 1

    Fortran is hardly used these days, while SQL is still ubiquitous. In recent years people seem to have stopped predicting SQL's demise. SQL has its weaknesses, but is extremely useful if you know its strengths.

    1. Re:Fortran vs. SQL by Aardpig · · Score: 1

      Fortran is hardly used these days

      Not true; new Fortran standards were issued in 1990, 1995 and 2003/4, and it continues to be a majority player in High Performance Computing (HPC). While this is certainly a niche area, it is the area that Fortran was originally designed to compete in. Nobody ever intended the language to be for writing operating systems.

      Whereas SQL is a rather lightweight scripting language for database manipulation. Not in the same league; when did you last work on project with 500,000 lines of SQL?

      --
      Tubal-Cain smokes the white owl.
  47. Is it just me... by angst_ridden_hipster · · Score: 2, Funny

    ... or did they consistently replace "APL" with "FORTRAN" in the article.

    I could fix that for them with sed, or maybe a Perl script. Now, where did I leave all my leaning toothpicks...

    --
    Eloi, Eloi, lema sabachtani?
    www.fogbound.net
  48. More fucking politics by HarveyBirdman · · Score: 0, Offtopic
    The WMDs that the UN inspectors that Iraq charged were spies failed to find were a figment of Bush's mind.

    Is it possible AT ALL to escape people's dumbass politics? I did not vote for Bush, and I did not support a full invasion of Iraq, but every intelligence agency in the Universe thought the WMDs were there, INCLUDING the French. The debate was over letting the UN inspectors work some more.

    I remember when I used to be able to read a technical article without the authors personal brand of ideo-illogical mental illness polluting the writing. It can't be done anymore. Everyone has to be a little activist now. Oooo! All trendy! And, yes, it matters. If he's that dumbass on history he actually lived through, why should I trust his opinion on anything else?

    --
    --- Ban humanity.
    1. Re:More fucking politics by Anonymous Coward · · Score: 0

      Everyone has to be a little activist now.

      A country just got flattened. Please show some respect for those of us that are still human enough to care.

    2. Re:More fucking politics by HarveyBirdman · · Score: 1
      A country just got flattened. Please show some respect for those of us that are still human enough to care.

      So do you want? A medal? Don't you get tired of reading the politics EVERYWHERE? And Iraq hasn't been flattened, you utter dumbass. Ah, I wish the lot of you, Left and Right, would all just drop dead of brain aneurysms.

      --
      --- Ban humanity.
  49. FORTRAN Ugly? by Hu's_on_first · · Score: 2, Funny

    Have you ever had the misfortune of working with APL?

    1. Re:FORTRAN Ugly? by Daniel+Boisvert · · Score: 1

      Yes. Please don't remind me of it again.

  50. Your description sounds more like APL/Labview... by mykepredko · · Score: 1

    Your description of the purpose of Fortran doesn't really match anything I have seen before regarding it. My understanding is that Fortran was the first "high level" programming language and was designed to be used by everyone not just poorly trained egineers and scientists.

    Being "first" had some advantages (namely long life) but many disadvantages as different programming styles and methodologies had not yet been invented, discussed or evaluated. As far as I can tell later versions of Fortran (ie IV, V, and 90 although not ANSI) were attempts to "modernize" the language and provide it with structured language extensions, etc.

    In coming of age in the late '70s, early '80s, I generally saw people who were not formally trained in programming gravitating to "APL" which was a truly bizarre language/operating environment. For certain types of applications (primarily matrix operations), such as multiplying two matrices together in one line of code, it was fantastic. Unfortunately, the operator set used with APL uses non-standard (ie non-ASCII) characters which made the code impossible to follow unless you had a reference in front of you (or were very, very experienced in developing APL code). One of my first jobs was maintaining APL based applications that interfaced with system resources through the use of APIs. I would have preferred the "line noise" of Perl over what this looked like.

    More recently, "Labview" seems to have taken over as the medium of choice for these applications. While it is outstanding as an application tool for developing fast instrumentation interconnect logic, traditional programming structures (like a "while loop") come out more like a page of Pentium IV schematics.

    I think that you've gone too far in stating that Fortran was designed for just engineers and scientists, especially when compared to langauages/operating environmnets designed specifically for engineers and scientists. Fortran was simply the first product of an immature science.

    myke

  51. "form dictates content" by Anonymous Coward · · Score: 0

    premise is false

    beer fits fine in kegs, bottles, cans, my belly, and that hot chick in the wheelchair!

  52. In Soviet Russia... by dim5 · · Score: 2, Funny

    the keycard punched YOU!

    --

    Is something burning?
    Oh, it's my karma.

  53. In the good old days by Cro+Magnon · · Score: 1

    Way back when, you only had a few choices. If you were a scientist/engineer you used Fortran. If you programmed business/text applications you used Cobol. Fortran stunk for business use, and Cobol stunk for math uses.

    --
    Slow down, cowboy! It has been 4 hours since you last posted. You must wait another few hours.
    1. Re:In the good old days by seminumerical · · Score: 1
      Fortran stunk for business use, and Cobol stunk for math uses. In the late 70's I took turns writing COBOL and FORTRAN for the Marketing and Engineering departments of a telecom company (Teleglobe Canada). With a mad logic, programs for engineering were always written in FORTRAN. It wasn't deemed so, it simply was obviously so and never questioned, regardless of the application. So for the Engineering department's business related work, project planning, budgeting, etc. M.I.S. wrote, maintained, did the data entry for, and scheduled FORTRAN programs, and for Marketing M.I.S. wrote, maintained, did the data entry for, and scheduled COBOL programs.

      This is a long way around of saying that I did the same, or very similar, work in FORTRAN and COBOL at the same time in my life (as an impressionable teenager) and FORTRAN (a very poor language) was streets ahead of COBOL for business apps. Very roughly, source code was around 1/4 as long in FORTRAN. By the time I was experienced, I averaged 70 lines of code a day in either language (a strange mythical man month metric that is) so the COBOL projects cost a fortune.

      The key moment came when I needed a queue of queues. In FORTRAN IV you could fudge an array of "queues" (although with limited "core" memory on a Univac 1106, reams of large static arrays were no picnic), but it was simply not practical in COBOL.

      --
      In wartime... truth is so precious that she should always be attended by a bodyguard of lies. (Churchill)
  54. Kernighan and Plauger by benj_e · · Score: 1

    Every programmer should have this book in their reference library.

    I got mine in '84, and even though I didn't work in Fortran or PL/I I still found it incredibly useful.

    --
    The Tao that can be spoken is not the one eternal Tao
  55. Write it in FORTRAN, if you can't write it in asse by www.sorehands.com · · Score: 1
    "If you can't do it in FORTRAN, do it in Assembly language. If you can't do it in Assembly, it isn't worth doing."

    A Guide to Real Programmers.


  56. 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!

    1. Re:Punched Cards and Rubber Bands? LUXURY! by johnlcallaway · · Score: 1

      You had punched cards?? What a baby. Back when I started, all we had were zeroes, we didn't even have ones yet. 'Here's the bug. Three zeroes in a row are a branch. I meant to use two for a move'. Try debugging that!!!!

      --
      I rarely read replies, it's my opinion and if you thought about your opinion a little more, I'm OK with that.
    2. Re:Punched Cards and Rubber Bands? LUXURY! by ChuckleBug · · Score: 1

      You had zeroes?!? Before the punchcards, all we had were buckets of cow dung, and if we did anything at all, including nothing, we were killed! Twice!

  57. Shouldn't it be "Dont Write C"? by EatingPie · · Score: 1

    I mean... so where is the "Obfuscated Fortran Contest"??? Teaching good (pretty) programming principles are a relatively recent development ('80s?). Fortran is freakin' old and a lotta legacy code comes from before the "pretty programming" era. And let's face it, a lotta science/math profs use Fortran -- and they wouldn't take a structured programming class to save their lives. My work deals with a lotta NASA code. Our joke has become "written by Physics grad students enslaved to Physics professors." A porter/debugger's nightmare! And it ain't limited to fortran -- the C code is just as bad, if not worse. The moral of the story (and it's been said before): You need to know HOW TO write good code before you can write good code... and these principals (generally) apply across languages. -Pie

    1. Re:Shouldn't it be "Dont Write C"? by EatingPie · · Score: 1

      Or "Don't Write Text."

      I had that post formatted so nicely, but forgot to select "Plain Old Text" before posting.

      Sheesh.

      -Pie

  58. 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.
  59. How long did you... by Anonymous Coward · · Score: 0


    How long did you live with wet feet until someone told you to lift the toilet seat before taking a piss?

  60. 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.
    1. Re:A bit like Visual Basic by adolfojp · · Score: 1

      I started programming real world applications in Visual Basic. My code was basically a very, very long page of unrelated functions, intermixed app logic, presentation logic and sql strings. The configuration settings were ussually compiled also.

      I moved on from those techniques (of lack thereof) before I did any real damage, but the other day I had the "pleasure" of finishing a very lengthy C# comercial application that was written by someone else in stereotypical VB style.

      As you say, you can write bad VB code in any language. It is not that way because VB is inherently bad, but because VB made it easier to allow everyone and their cat into the world of programming, even people like me :-).

      Cheers,
      Adolfo

    2. Re:A bit like Visual Basic by Saeed+al-Sahaf · · Score: 1
      There are so many crappy visual basic applications out there designed by 14 year olds with no understanding of... Blaw, blaw, blaw...

      Show me a 14 year old FORTRAN programmer, and I'll show you a _guy_ how has a great future in CS, possibly at Google or MIT or some place that hires smart people.

      Now the, you where talking about VB???

      --
      "Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
    3. Re:A bit like Visual Basic by dbottaro · · Score: 1

      Aw c'mon now folks... Visual Basic even before .NET was at least partially object oriented. While most VB developers don't really get OOP, it was available.

      With the coming of VB.Net, VB has actually grown up into a real OO language. No longer just for RAD work, but for real quickly developed deployable applications.

      I would also like to mention that you can write messy, unmaintainable code in just about ANY language. I have seen some DOS batch files that would make Bill Gates puke!

      --
      Coding my way to the next BSOD!
  61. form, style, design, coding by br00tus · · Score: 1
    As the article says, it is comments on form and style, not design, best coding practices and the like. Most of my form and style is automagic - "indent -kr *.c". The two things of minor interest here is he weighs in that underscores in variables are better, as well as his comments that we write code for ourselves and our brains (as well as others) to read. Much of the rest I've heard before.

    I just skimmed through "Code Complete, Volume 2" and although form and style were not the most interesting things I learned from it, I learned more about them in the book than this article. For example, one change I made recently in my code due to CC v.2 is changing

    array[4] = 5; // ttl
    to:
    int ttl;
    ttl = 5;
    array[4] = ttl;
    Then again I like to mix // comments with /* */ in my C code, and I know some frown on that, but I don't care (unless I someday run into a compiler that barfs on it, I suppose). In some ways the above goes to this person's theme - the "keep it simple stupid" strategy is followed in the second example, not the first. Or in other words, simple does not necessarily mean "less code".

    I learned a lot of good stuff from Code Complete and will have to check out other books I've been recommended (I have The Art of Computer Programming, but it is not the kind of quick and applicable type of book that Code Complete is, no "how to calm your boss down" advice in the middle of chapters). Especially ideas like functions should do one thing and do it well, functions should attempt to keep from using more than seven variables, the ideas of function cohesion and so forth.

    I have not yet seen anything even approaching something like Code Complete on the web. I wonder why the free software community, which hopes to improve programming of its contributors, I'd think, has not written good, free stuff on how to write good code and put it on the web (aside from things like Linus's short CodingStyle). Some advice you don't even see much, like how to deal with APIs.

    Perhaps the most important thing I've learned in all of this is that work pressure seems to create bad coding practices. I thought I'd try to get a job programming C to learn more on the job, but so many people complain about work pressure hurting their code, I think I'll stick to being a sysadmin, and writing code on my own time, at the pace I want.

  62. Blast from the Past by mborland · · Score: 2, Interesting
    Apologies in advance, this reminded me of something I ran into a few years go. This is a two-page ad from a New Yorker magazine in 1968 (or 1969, not sure which). I was so interested in the ad that I transcribed it and put editorials in brackets.

    [A two page ad. A middle-age man with a youthful, shy grin, dark horn-rimmed glasses, slicked, short hair, and the premonition of a hairy chest emerging from a blue denim(?) shirt, fills the left page; the vista of urban sprawl outside a window behind him; painted scrawls of mathematical formulas superimposed. On the right hand page is a block of sans-serif text]

    Meet an elder statesman in the computer business.

    IBM's Jon Backus is 43, pretty young for an elder statesman in most industries. But then, the computer business is less than 20 years old and a mathematician Bakcus has been in it since the beginning. He started workig with computers in the early 1950's. It was about the time a leading business magazine estimated that no more than 50 companies would ever have use for a comptuer. Today, it is estimated that there are well over 50,000 comptuer installations in the United States alone. Part of the reason for this astonishing growth: the progress made in programming. In this field, John Backus was a pioneer. "It bothered us, in the early days of computers, that so few people coluld use them" he says. "One reason was, programming cost as much as the machine. A small compnay just couldn't afford data processing." With a small group of associates, John Backus tackled the problem and stayed with it for three years. The result was the simplified programming system called FORTRAN (FORmula TRANslator) which made programming considerably less expensive than before. Today, FORTRAN is probably the most widely used programming system in the world. Currently, John Backus is working on a new mathematical concept which is still in the realm of pure theory. But his theories, like the work of many IBM scientists, ultimately have a way of making computers more useful.

    [A red line runs across the text. A matching red 'IBM' (not the blue, CRT lines version) appears in the margin.]

    From a beginning less than two decades ago, computer technology has made remarkable progress. John Backus is one of many outstanding men and women in the industry who have turned a laboratory marvel into tens of thousands of computers helping people around the world.

    1. Re:Blast from the Past by mborland · · Score: 1

      Apologies for my numerous spelling errors. I was at some clunky terminal at the time I transcribed this (5 years ago) and didn't know how to go back and make corrections.

  63. 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
    2. Re:Yes, older languages can be ugly... by lgw · · Score: 1

      This is a much-needed philosophy that doesn't seem to be taught any more. Program well, and you don't need the language to provide you with crutches for maintainable code. Good maintainable code will always come from the programmer, not the language. The language can certainly make it *faster* to write maintainable code, but will *never* prevent horrid code.

      Only the programmer can prevent horrid code.

      Many CS programs still require a assembler class, but so much more could be learned from an assembler class graded entirely on style. :)

      --
      Socialism: a lie told by totalitarians and believed by fools.
    3. Re:Yes, older languages can be ugly... by Smooth+Hound · · Score: 1
      C has something like that, that is if you mistype a comma for a dot you get a valid program. e.g.
      while (x<5.0) ...
      becomes
      while (x<5,0) ...
    4. Re:Yes, older languages can be ugly... by Rumata · · Score: 1
      Which led to the loss of a space probe, back in the day.


      Do you have a source for this? I've heard this story (or a similar one) before. But in the version I heard, it just turned out that a new trajectory software wasn't quite as accurate as it was expected to be.

      After much wailing and gnashing of teeth, the problem was tracked down to the code you showed; i.e. a iterative method was executed just once instead of 10 times. But in my version this happened before the software was used to calculate a trajectory for a real probe.
    5. Re:Yes, older languages can be ugly... by Tablizer · · Score: 1

      DO 100 I = 1.10 ... Which led to the loss of a space probe, back in the day.

      Almost every single language has oddities which can lead to typo-related bugs. I remember I got stuck in an infinite loop in Pascal once because I inadvertently put a semi-colon right after the FOR statement. I have never met a language that did not have gotcha's. Please stop picking on FORTRAN alone for having them.

    6. Re:Yes, older languages can be ugly... by AJWM · · Score: 1

      Original source, nope. So it may well be an urban legend, but there are additional details: The spacecraft was an early Venus probe. The loss was because the launch was sufficiently off course that the Range Safety Officer called an abort, and blew it up.

      --
      -- Alastair
    7. Re:Yes, older languages can be ugly... by AJWM · · Score: 1

      Oh, I've picked on plenty of other languages too. It's just that I don't think any other that I've used has led me to the level of cursing that FORTRAN has.

      Oh, except maybe COBOL.

      (For my sins, I've had to maintain tens of thousands of lines of other people's FORTRAN code at various points in my career, including early versions of SPICE, which inserted machine code into an array and then passed execution to it! OTOH, "Collosal Cave" wasn't bad.)

      --
      -- Alastair
  64. My Fortran Story by Anonymous Coward · · Score: 0

    My 1976 Fortran class, quote from the instructor: "You will NEVER use this" punch cards, all the old stories. Flash forward to 1984 job interview for a programming position, so what language are you using for your business application? Ans: Fortran...FORTRAN IV. So you want the job? Ahh, WTH, ok. It ran in on a 2Meg memory space and would support 40 terminals, then expanded to 80 then 120. Screens, batch jobs, point of sale, all night compiles, huge business functionlity (for its time). Company grew from 28 to 280 employess moved on to Oracle (bleeding edge in 1986), I'm still with the company.

  65. Oh dear. by ledow · · Score: 1

    Well, I RTFA and I can quite easily summarise it for those who didn't:

    When programming:-

    Use whitespace properly.
    Use comments effectively.
    Name your variables sensibly.

    This is programming beginner's stuff and barely worth reading through 5 pages of diatribe, padded with quotes and pointless examples.

    Considering the technical audience of Slashdot, I'm surprised it ever made it to the front page.

    1. Re:Oh dear. by Anonymous Coward · · Score: 0

      This is programming beginner's stuff and barely worth reading through 5 pages of diatribe, padded with quotes and pointless examples.

      Perhaps, but I regularly see thousands of lines of source code in C and even more so in C++ by programmers with lots of experience and credentials who have no clue about the point you mention.

      Poor or complete neglect for white space, comments and readable variable names are my biggest headaches when I have to take over the code written by my colleques in C++.

  66. Speed of Fortran by siskbc · · Score: 1
    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.

    It's not optimized at all. Matlab is great for doing routine work - I use it all the time - but it'll never compare to Fortran for something you REALLY need to be fast.

    Check out some of the numerical libraries for python (Numpy, etc.) - they're all wrappers around compiled FORTRAN. Why? Fortran's made to do math. Partly the languages, partly the compilers available, but in the end, it'll do matrix math faster than anything. C++ most certainly included

    --

    -Looking for a job as a materials chemist or multivariat

    1. Re:Speed of Fortran by Kiryat+Malachi · · Score: 1

      MATLAB can compile and optimize code; I forget which toolbox you need for this, but it can in fact produce compiled C code to run your scripts. This can net you anything from factor of 1 to factor of 50 improvement (yes, I have seen a factor of 50 improvement) over the raw script, which usually isn't awful these days.

      Have never compared it to FORTRAN in speed, but the fact that it's a lot quicker to write/maintain makes most of that speed differential meaningless.

      --

      ---
      Mod me down, you fucking twits. Go ahead. I dare you.
      (I read with sigs off.)
    2. 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.

    3. Re:Speed of Fortran by siskbc · · Score: 1
      MATLAB can compile and optimize code; I forget which toolbox you need for this, but it can in fact produce compiled C code to run your scripts. This can net you anything from factor of 1 to factor of 50 improvement (yes, I have seen a factor of 50 improvement) over the raw script, which usually isn't awful these days.

      I know that - but it ain't that great. Better than Matlab natively, yes - I mean, it's an interpreted language, it has to be - but it's not good on par with good C++, and can't touch Fortran. If speed of execution doesn't matter that much, don't worry. If it does, you won't use matlab, compiled or not.

      Have never compared it to FORTRAN in speed, but the fact that it's a lot quicker to write/maintain makes most of that speed differential meaningless.

      Sure. I have one friend who actually develops in Fortran because it's what his dad recommended. I think he's insane. So sure, for day to day stuff I use matlab.

      When I need speed, I get the best of both worlds - I develop in python, which is on par with matlab for development speed, and it calls screaming Fortran libraries (via NumPy) I didn't write myself. Can't beat that - speed of Fortran, ease of Matlab. If you only use Matlab, try Python with NumPy sometime. I did, because of that and because of Matlab's being proprietary. You'll never know when your next job won't support matlab, and knowing other scripted development methods is a very good thing.

      --

      -Looking for a job as a materials chemist or multivariat

    4. Re:Speed of Fortran by NoOneInParticular · · Score: 1
      Sorry, but no. Have you ever looked at the source code Matlab produces? Every single line of code hooks into the Matlab library and does numerous checks for bounds, matrix dimensions, whatever. Even a simple for loop (for i=1:10) becomes a set of calls into the library. With that comes a general C compiler that cannot do the type of optimizations a Fortran compiler can make (due to aliasing), and the conclusion is clear. Compiled Matlab code is nowhere near the speed of Fortran.

      The factor 50 improvement you get with using the compiler, still leaves you with a large factor from actual Fortran performance. I've done some tests myself between compiled matlab and hand-written C that used the Matlab routines, and the C code beat the Matlab generated code by a factor of 20. Granted, that code used a lot of loops, but that was the reason I wanted the code to be compiled. And as for performance being irrelevant compared to quickness to write/maintain, this does not hold for numerically intensive code, where a slowdown smaller than 2 is probably acceptable, but not the orders of magnitude that Matlab seems to come with.

      Today I write my bottleneck code as external C programs (mex-files) for Matlab.

    5. Re:Speed of Fortran by Kiryat+Malachi · · Score: 1

      It's actually approximately as good as what our C programmers come up with; we've tested this by using the ACG stuff against equivalent hand-developed algorithms inside of MEX wrappers.

      And if you're really concerned about proprietary - Scilab, man, Scilab. That said, I refuse to work for anyone who won't buy me a copy of MATLAB - I consider it the most essential tool for my job, which is fine, since everyone else in my industry does too (signal processing and control systems development - rare to find anyone who doesn't use MATLAB).

      Also, if I need external libraries - MEX and wrappers. Since MATLAB incorporates BLAS and LAPACK, the linear algebra routines are already there. At this point, the slowdown is message passing from the FORTRAN routine back to MATLAB, and if that begins to take up the majority of the time in your code, odds are you didn't need to use the FORTRAN routines anyway.

      --

      ---
      Mod me down, you fucking twits. Go ahead. I dare you.
      (I read with sigs off.)
    6. Re:Speed of Fortran by Kiryat+Malachi · · Score: 1

      How much CPU time do you save, total, versus how much engineer time? How much does CPU time cost? I'm going to tell you that only on the largest simulations, run many times *without tweaking of the model*, will CPU time outweigh engineer time.

      --

      ---
      Mod me down, you fucking twits. Go ahead. I dare you.
      (I read with sigs off.)
    7. Re:Speed of Fortran by mprinkey · · Score: 1

      I've worked in the Aerospace biz many years and have never seen big number crunching programs done in C/C++ or Java.

      Several major commercial computational fluid dynamics codes are written in C or C++. It wouldn't surprise me that your "in-house" codes are still coded in some FORTRAN variant, but commercial vendors moved onto C about a decade ago.

    8. Re:Speed of Fortran by twiddlingbits · · Score: 1

      CPU time runs upwards of $5000 an hour on a large system. Engineer time is about $150. But think over the LIFETIME of the code, which in some systems is 30 yrs. You really don't save much time writing it in C, in fact I'd say (being a C programmer) it takes longer to write in C, and for SURE longer to debug if something goes wrong. C is a very powerful general purpose programming language and gives you lots of ways to kill your code. FORTRAN is simple,straightforward and good at Math, but useless for everything else. I like C, and I hated writing FORTRAN code but different tools for different jobs.

    9. Re:Speed of Fortran by twiddlingbits · · Score: 1

      True, but in house code is free in most cases, the code having been depreciated to zero, plus the execution time is well known. And the results are proven! Engineers don't like to change away from what they know works, and sometimes that is a problem.

  67. Ah... But which notation is clearer? by Richard+Steiner · · Score: 1

    A Fortran logical equivalence comparison and variable assignment:

    A .EQ. B
    A = B

    A C logical equivalence comparison and variable assignment:

    A == B
    A = B

    Guess which language is more susceptible to subtle typos which can radically change the behavior of the program? :-)

    --
    Mainframe/UNIX Bit Twiddler and long time Windows/Linux Hobbyist.
    The Theorem Theorem: If If, Then Then.
  68. 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 Rei · · Score: 1

      Could you give specifics, please? That post was a bit too abstract to give any credence to. What calculations? Why do these use less code (and how do they compare to C++, with its use of operators and templates?).

      Also, pointers are a mixed bag, mind you, but no one says that you have to use them (especially in C++). Also, why use gotos at all (let alone computed gotos)? Gotos are nasty things that fight your ability to break code into logical code blocks.

      --
      We also have a halon fire extinguisher. Its always nice to have a fire extinguisher that kills people around.
    2. Re:hardly unfortunate by joggle · · Score: 2, Interesting
      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.

      With libraries like SPOOLES I don't need to. One of the primary advantages of C is the availability of many libraries out there that have been developed over the years. Of course, this is in general. In specific domains (like particle physics) the great deal of Fortran code out there ensures that the language won't go away any time soon.

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

    4. Re:hardly unfortunate by Fruit · · Score: 2, Informative
      Actually C has those too:
      int main(void) {
      char x[7][13];
      printf("%d\n", sizeof x);
      return 0;
      }

      % ./a.out
      91
    5. Re:hardly unfortunate by hawk · · Score: 2, Insightful

      Generally, I mean sustained heavy calculation with large blocks of data.
      '
      Sure, you *can* write those operators and templates, but they tend to already be there in Fortran. And if they're not, it's near certain that you can find existing, well-tested libraries.

      The "less code" was my own experience several years ago while still using both for this kind of work. It's been long enough that I"m straining to remember specifics, but the dusty brain cells want to say [no, scratch this example; it make no sense].

      Whether you use pointers or not, the C compiler may be forced to make allowances for it. Fortran pointers are far more limited, and the compiler needn't consider the extra possibilities.

      And as for goto? Why is it any worse that one exists in Fortran than C? I've used one twice in the last ten years (or is it once). The alternative was setting a status variable to be checked to skip the block of code (for the general case) immediately following the select case structure. I *could* have avoided the goto, but the code was much clearer by using it.

      hawk

    6. Re:hardly unfortunate by Anonymous Coward · · Score: 1, Insightful

      I think part of the problem is that many of us learned FORTRAN 77. I had a prof in college who was a FORTRAN fanboy, and he quoted someone saying, "I don't know what the language of 2000 will be, but it will be called FORTRAN." Basically, rather than dumping the old design and starting over with a new math-based language, they are just evolving the old one to the point where it is no longer the same beast it used to be. I haven't even looked at the latest versions, but I gather they might be acceptable to a computer scientist.

      Whether this is a good thing or a bad thing is another discussion. Programmers like to start over with the assumption that "it's going to be right this time." Often, though it's better to make incremental changes on a well established base. It all comes down to how much change is required, I guess.

      Lucky for us all, there's no lock-in on languages. You can use FORTRAN, I can use C, someone else can use Perl. Here's to healthy competition (which seems to be a rarity these days.)

    7. Re:hardly unfortunate by YU+Nicks+NE+Way · · Score: 1, Informative
      You didn't read what I wrote. Yes, C has [][] allocators, but it does not have multidimensional dereference. If you want to iterate through the elements in the array that you allocate using
      char x[5][10]
      you have to do it by hand
      for (i = 0; i < 4; i++)
      for (j = 0; j < 10; j++)
      {
      *((char *) (&x[0][0])+ 10 * i + j) = '\\n';
      }
      That's why people talk about writing custom libraries to support scientific caculations in C.
    8. Re:hardly unfortunate by Anonymous Coward · · Score: 0

      Only true if the array is manipulated in a statically-sized context, where the dimensions the array is -assumed- to have are known at -compile time-. sizeof() doesn't even -work- at runtime, it's compile-time only. This is hardly practical for implementing general-purpose dense matrices.

      Of course, you can get around this with C++ classes or C libraries, but the fact that the fundamental data types of C and C++ don't support proper arrays is still a massive pain IMO.

      (And no, std::vector is not a fundamental data type. You can't say

      std::vector a = {1.0, 2.0, 3.0};

      and expect it to work. There's no way to write that kind of constructor for vector.)

    9. Re:hardly unfortunate by Rei · · Score: 1

      I'd be very surprised if the compiler didn't not only eliminate one loop, but both of them, at compile time.

      --
      We also have a halon fire extinguisher. Its always nice to have a fire extinguisher that kills people around.
    10. Re:hardly unfortunate by Anonymous Coward · · Score: 2, 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.


      Actually, it doesn't any more. Hate to be the one to break it to you, but C hasn't stood still either.

      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.

      BZZT, wrong! The latest version of C, "C99" (supported by almost every compiler out there, including GCC) adds a keyword that might be useful for you:

      restrict

      Here's how you use it. When you declare a pointer variable (maybe you have a function that accepts an array of floats), instead of going:

      void myFunction(float *myListOfNumbers) { /* blah blah */}

      you write:

      void myFunction(float *restrict myListOfNumbers) { /* blah blah */}

      What does that do? Well, when you 'restrict' a pointer, it means you are telling the compiler that the memory it points to will only ever be accessed by using that pointer. (And not, say, by some other completely different function that just happens to create the same pointer (value) and twiddle bits of memory independently.)

      What does that _mean_? It means that you get the "FORTRAN memory access model", exactly where you want it, with just a few keystrokes. All the optimizations your FORTRAN compiler does, your C compiler will do too, since they become legal.

      There's nothing unfortunate at all about Fortran's (not FORTRAN any more) role in scientific computing.

      Indeed! As a working scientist, I'm sometimes happy that others still use junk like Fortran: less competition for me to worry about! :) I shouldn't be so nice, but if you want to learn more about this, you might start here:

      http://sc.tamu.edu/help/power/powerlearn/html/Sc al arOptnw/sld042.htm

    11. Re:hardly unfortunate by Rei · · Score: 1

      > There's no way to write that kind of constructor for vector

      Um, yes there is.

      const float tmp[] = { 1.0, 2.0, 3.0 };
      std::vector a(tmp, tmp+sizeof(tmp)/sizeof(*tmp));

      Just because *you* don't know how doesn't mean that it doesn't exist. Sure, it takes two lines, but big deal - I could easily macro that or subclass it if it bothered me.

      --
      We also have a halon fire extinguisher. Its always nice to have a fire extinguisher that kills people around.
    12. Re:hardly unfortunate by Smooth+Hound · · Score: 1
      No, it does not.
      int main(void){
      char x[3][3];
      printf("%d\n",sizeof(x)); /* Prints 9 */
      foo(x);
      return 0;
      }

      void foo(char **x){
      printf("%d\n",sizeof(x)); /* ERROR! */
      }
      While in Fortran90 it works.
      program bar
      integer :: x(3,3)
      print*,size(x) ! Prints 9
      call foo(x)
      end

      subroutine foo(x)
      integer, intent(in) :: x(:,:)
      print*, size(x) ! prints 9 again
      return
      end
    13. Re:hardly unfortunate by Rei · · Score: 1

      Without specifics, I can't comment on the first three paragraphs. However, your comment:

      "Whether you use pointers or not, the C compiler may be forced to make allowances for it"

      What allowances are you thinking of? I can't think of any. All variables are really pointers inside at the system level as it is (except ones with a very local context which can be optimized into registers), so it wouldn't seem to make much sense that support for pointers would be a slowdown. Besides, most modern compilers have flags that give you a great deal of control over how to use pointers (if you're going to use them).

      "Why is it any worse that one exists in Fortran than C"

      Neither are worse. Neither should be used. But let me tell you, even on modern Fortran code, I've seen far, far more gotos than in C.

      > the alternative was setting a status variable

      There are a number of other alternatives as well - repeating the test condition that led to the need to skip the code in the first place, breaking the inner code into a function call and then simply returning out of it (good clean code makes ample use of function calls), etc.

      --
      We also have a halon fire extinguisher. Its always nice to have a fire extinguisher that kills people around.
    14. Re:hardly unfortunate by Anonymous Coward · · Score: 0

      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.

      This is completely wrong. You don't understand C at all.

      If I define an array like:
      int a[20][96];
      That will be a contiguous block of storage, because this is read as: an array of 20 arrays of 96 integers (not pointers, you are a stupid fuckwit, and wrong).

      Ironically this whole point is discussed at length in Numerical Recipes, and at the time it was written it was argued that constructing arrays of pointers was PREFERABLE to a multidim array. One of the reasons being that the multiplication was costly (unless it was small), and the extra dereference was relatively cheap. On RISC machines like an ARM, this is still certainly the case (unless of course your dimensions are powers of 2 or your dimensions are relatively small).

      Someone will have to explain to me why on a modern x86 this isn't true also. As I understand the pipeline design, multiplication has more pipelining cost then dereferencing. Like in the Pentium, only one pipe could handle muls, so there were more stall harzards with a mul. The Pentium Pro is different and I have been out of the x86 arch details too long.

      You're still an idiot though.

    15. Re:hardly unfortunate by Jhan · · Score: 1

      [C] does not have multidimensional dereference.
      ...
      char x[5][10];
      ...
      *((char *) (&x[0][0])+ 10 * i + j) = '\\n'; // sic! (warning: multi-character character constant)

      Informative my sphincter. Come on, aren't we all supposed to be C gurus on Slashdot?!

      bash-2.05a$ vi t.c
      main()
      {
      ____int t[2][2]={{1,2},{3,4}};
      ____printf("%d\n", t[1][1]);
      ____t[1][1]=17;
      ____printf("%d\n", t[1][1]);
      }
      bash-2.05a$ make t
      cc t.c -o t
      bash-2.05a$ ./t
      4
      17

      ...and of course, the multidimensional array is stored as a single contigous memory area, no "pointers to pointers" crap. You were saying?

      --

      I choose to remain celibate, like my father and his father before him.

    16. Re:hardly unfortunate by Anonymous Coward · · Score: 0
      Parent wrote:
      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)
      This actually depends on the type declaration of a! See the following examples:
      int f1(int **a) { return a[7][13]; }
      int f2(int *a[42]) { return a[7][13]; }
      int f3(int a[42][42]) { return a[7][13]; }

      In the above examples, f1 and f2 produce identical machine code with two derefernces:

      addl $28, %eax
      movl (%eax), %eax
      addl $52, %eax
      movl (%eax), %eax

      but f3 only uses one dereference because we told the compiler the size of the array was 42x42:

      addl $1228, %eax
      movl (%eax), %eax

      Note: 1228 = 4 * (42 * 7 + 13), where sizeof(int) == 4.

    17. Re:hardly unfortunate by uid8472 · · Score: 1

      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.

      C does have true multidimensional arrays; you declare them like int a[32][32][32][32], rather than int ****a. They don't have a special syntax because they don't need one.

    18. Re:hardly unfortunate by Dachannien · · Score: 2, Informative

      Either that's a bad example, or compiler optimization has come a long way, baby. Or maybe I just don't get what you're getting at. But a quick test using gcc reveals this:

      http://sokar.cwru.edu/multidim.html

      Note that the code that calculates the offset into the x array (italicized for convenience) is one instruction shorter for x[i][j] rather than the code you listed.

    19. Re:hardly unfortunate by Anonymous Coward · · Score: 0

      but f3 only uses one dereference because we told the compiler the size of the array was 42x42:

      addl $1228, %eax
      movl (%eax), %eax


      Right, and if the offsets were not computable at compile time a multiply would need to be used (Yes, I know with an offset of 42 it will synthesize with adds and scales. but for larger multipliers it would need to use an imull, which for many processors is relatively very costly.

    20. Re:hardly unfortunate by locofungus · · Score: 1

      It's no wonder there is so much crap code about when people claim things for a language they clearly don't know.

      #include <stdio.h>
      void foo(char (*x)[3][3]);
      int main(void){
      char x[3][3];
      printf("%u\n",(unsigned)sizeof(x)); /* Prints 9 */
      foo(&x);
      return 0;
      }
      void foo(char (*x)[3][3]){
      printf("%u\n",(unsigned)sizeof(*x)); /* Prints 9 */
      }


      As long as your types match you can pass multi-dimentional arrays around in C quite happily.

      Don't like the extra dereference? grab a c++ compiler instead (but carry on writing "C")

      #include <stdio.h>
      void foo(char (&x)[3][3]);
      int main(void){
      char x[3][3];
      printf("%u\n",(unsigned)sizeof(x)); /* Prints 9 */
      foo(x);
      return 0;
      }
      void foo(char (&x)[3][3]){
      printf("%u\n",(unsigned)sizeof(x)); /* Prints 9 */
      }


      Want to be able to pass arbitrary sized arrays? Now you are limited to C++.

      #include <stdio.h>
      template<int Y, int X> void foo(char (&x)[Y][X]);
      int main(void){
      char x[3][3];
      printf("%u\n",(unsigned)sizeof(x)); /* Prints 9 */
      foo(x);
      return 0;
      }
      template<int Y, int X> void foo(char (&x)[Y][X]) {
      printf("%u\n",(unsigned)sizeof(x)); /* Prints 9 */
      }

      --
      God said, "div D = rho, div B = 0, curl E = -@B/@t, curl H = J + @D/@t," and there was light.
    21. Re:hardly unfortunate by hankwang · · Score: 1
      What allowances are you thinking of? I can't think of any. All variables are really pointers inside at the system level as it is

      For example,

      void f(int* a, int* b, int n)
      {
      for (int i=0; i < n; ++i) a[i] = b[i];
      }
      The compiler might parallellize this under the assumption that a and b really are different arrays. You'd get unpredictable results if you do
      int x[100];
      f(&x[1], &x[0], 99);
      This code should copy the value of x[0] into the rest of the array, but a parallellizing compiler would do something completely different. This can't happen if there aren't any pointers in the language.

      By the way, I'm not a fortran fan. I don't usually program for supercomputers and I have heard someone defend fortran-77 because "you can read the code like English without all that cryptic syntax".

    22. Re:hardly unfortunate by Dachannien · · Score: 1

      Except that in foo, the static array x has gone out of scope, and the pointer x is in scope. Which is of course why foo will print 4 (on an x86 machine) rather than generate an error.

      This also is not indicative of a specific lack of multidimensional array dereferencing, because the same will occur with single-dimensional arrays as well. In C, if you really need the dimensions of an array to reach another scope from where it was declared, you can pass them in as parameters in some fashion.

    23. Re:hardly unfortunate by Rei · · Score: 1

      That makes no sense in the context, though. We were talking about whether there would be penalties because C supports pointers if you don't use them. Your example uses pointers.

      Besides, I think you meant "unroll" it instead of parallelize (compilers don't split things up into threads as a general rule, although that's starting to change, in a way, with the 64 bit architectures). If you meant unroll, unrolling wouldn't cause a problem because the code is still executed in-order. And if you truly did mean parallelize (as in the 64 bit chips where multiple paths are executed at once), the parallelization would be guaranteed not to write to memory until it was known that the memory locations used in computing the result for the particular path hadn't changed.

      --
      We also have a halon fire extinguisher. Its always nice to have a fire extinguisher that kills people around.
    24. Re:hardly unfortunate by fm6 · · Score: 1

      You raise some good points. But if you have to hand-optimize your C code, your compiler is not very good. Optimization is a feature of the compiler, not the language.

    25. 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.
    26. Re:hardly unfortunate by colinrichardday · · Score: 1

      In your int foo example above, would I have to have a value for all of the dimensions except the first?

      int foo(int a[][M][N])

    27. Re:hardly unfortunate by Autonomous+Cow · · Score: 1

      "What allowances are you thinking of? I can't think of any. All variables are really pointers inside at the system level as it is (except ones with a very local context which can be optimized into registers), so it wouldn't seem to make much sense that support for pointers would be a slowdown. Besides, most modern compilers have flags that give you a great deal of control over how to use pointers (if you're going to use them)."

      Google around for pointer aliasing for an idea of some of the fun optimizations that C compilers cannot do on legal C code. Granted if you are willing to limit your coding idioms AND do some indepth auditing of your pointer usage, some C compilers will let you say, in effect "I know what I'm doing, do these normally unsafe optimizations anyway."

      --
      The Autonomous Cow. Moo.
    28. Re:hardly unfortunate by Rattencremesuppe · · Score: 1
      I think you meant "unroll" it instead of parallelize (compilers don't split things up into threads as a general rule, although that's starting to change, in a way, with the 64 bit architectures)

      FYI, parallelize can also mean something SIMD-like (SSE, MMX, AltiVec, you name it). If I'm not smoking crack, the previous poster's code example would also be broken if the copy operation was implemented using SIMD.

    29. Re:hardly unfortunate by Anonymous Coward · · Score: 1, Informative
      > Why do these use less code

      An example:
      real a(-1:M+2,-1:N+2,L1), b(M,L2,N), c(M,N,L,L3)
      a(1:M,1:N,2) = sin(b(:,1,:)) + cos(c(:,:,2,3)) !! all are M x N arrays.
      In Fortran, you can take "sections" of arrays. Also, although indices start from 1 by default, you can specify the lower limits if you like, as in the first array "a" above, which has -1 as the lower limits of the first two dimensions. Intrinsic functions can be applied to arrays and sections of arrays. The language has the syntax for these features. In C++ the above code would be
      float a[M+4][N+4][L1], b[M][L2][N], c[M][N][L][L3];
      for (int i=0; i<M; ++i)
      for (int j=0; j<N; ++j)
      a[i+2][j+2][1] = sin(b[i][0][j]) + cos(c[i][j][1][2]);
      But then, you have to remember i+2 for "a" corresponds to i for "b" and "c" because the lower bound of array indices are always 0 in C++.

      Array sections can be used as arguments to subroutines, as in
      call sub(a(3,:)) !! sub() expects 1-D array
      call sub(a(:,2))
      In C++, you can do this by defining a class representing multidimensional arrays. You would define arithmetic operations (+, -, *, /), and functions like sin, cos, log, exp, etc. for the class. You can even define array sections by defining a set of classes representing the notion of sections. Even then, your array classes would be far less easy to use than Fortran's native arrays.

      And even then, a C++ compiler can't apply as much optimization to your code as a Fortran compiler can. For example, a Fortran compiler can easily transform
      real a(M,N), b(M,N), c(M,N), d(M,N) ! 2D arrays
      a = sin(b) + cos(c) + tan(d)
      into the one-dimensionalized
      for (k = 1; k<= M*N; ++k)
      a[k] = sin(b[k]) + cos(c[k]) + tan(d[k]);
      The compiler can do this because arrays are native types and because the compiler knows the memory for each array is contiguous. Can a C++ compiler transform
      My2DArray<double> a(M,N),b(M,N),c(M,N),d(M,N);
      a = sin(b) + cos(c) + tan(d);
      likewise? I doubt it. I think a C++ compiler has to generate a temporary for the result of sin(b), cos(c), and tan(d), and add the first two temporaries, and then the third to get the final result.

      If there's a sizable demand for numerical computations in C++, then vendors would create a C++ compiler which has a built-in capability of efficient and convenient array operations and other stuff (like native complex numbers). But, that won't happen because people doing numerical computations are largely happy with Fortran 95 and those aren't happy with the language interested in numerical computations. Only minority of people (like me) aren't quite happy with Fortran 95 *and* are doing numerical computations.
    30. Re:hardly unfortunate by rfovell · · Score: 1

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

      Agreed. I'm not a programmer, I'm a scientist who writes programs (very important difference), and since I deal with equations, there's no comparison w/r/t code readability and error avoidance between Fortran and C. For me, Fortran wins hands down. Three reasons why:

      (1) equations look like equations, and arrays look like arrays. A block of my code might look like this, involving calculations moving over a 3D domain

      tp(i,j,k) = tm(i,j,k)-u(i,j,k)*(t(i+1,j,k)-t(i-1,j,k)) ... ... which in C -- unless there is a good and still clear way around it -- would look like

      tp[i][j][k] = tm[i][j][k] - u[i][j][k]*(t[i+1][j][k]-t[i-1][j][k])...;

      (2) Arrays naturally start at index 1, not 0. So for Fortran array TB(NZ), there are NZ elements, numbered 1...NZ, not 0...NZ-1. The most common error I've seen students make in C, by far, is trying to access array element NZ in array TB[NZ]. IMHO, those trained in mathematics, such as myself, find starting from index 1 much more natural, and expecting to be able to access array element NZ in an array dimensioned same also very natural.

      (3) IME, Fortran compilers give much better diagnostics regarding errors than their C counterparts, and point with greater accuracy to the line number of the code where the error occurs. Maybe I've only had crappy C/C++ compilers, but far too often the compiler fails to realize where the problem really lies.

      I never truly appreciated Fortran until I had to become familiar with C, because that's what students were being taught these days. So, when some silly geek scoffs, "You program in Fortran?" the proper answer is, "damn right I do".

      --
      Every rule has an exception (except this one).
    31. Re:hardly unfortunate by beliavsky · · Score: 2, Interesting

      >Could you give specifics, please? That post was >a bit too abstract to give any credence to. >What calculations? Why do these use less code
      >(and how do they compare to C++, with its use >of operators and templates?).

      Fortran 90/95/2003 shines in its treatment of multidimensional arrays. It resembles Matlab, with the advantages (and disadvantages) of a compiled language. Here are some of its specific strengths:

      (1) To dynamically allocate a 3D array the code is just

      real, allocatable :: x(:,:,:)
      allocate (x(n1,n2,n3))

      It's messier in C++.

      (2) The array can be passed to a function just as a scalar is, without needing to mess with pointers. Arrays know their own size, so the dimensions of the array need not be passed as function arguments.

      (3) Most intrinsic functions of Fortran are elemental, so exponentiating array x is done with just

      x = exp(x)

      No need for a triple loop as in C++.

      (4) There are fast, flexible array intrinsic functions. If x is a matrix, one can compute the sum of all elements, the sum of each column, and the sum of each row with just

      y = sum(x)
      y = sum(x,dim=1)
      y = sum(x,dim=2)

      (5) One can work with arbitrary array sections with notation such as x(1:n1:2,:n2-1) .

      (6) One can define elemental functions and subroutines that operate on a scalar or an array of any dimension, just as the intrinsic functions do.

      (7) Arrays of user-defined-types are convenient to work with. For example, given a data type

      type :: person
      real :: age,weight
      end type person

      One can declare

      type(person) :: players(10,20)

      and then access the array of ages with just

      players%age

      In C/C++ one has built-in access only to the age of a single person with something like

      players[0][0]%age

      (8) Arrays can have a lower bound of 1 (the default) or any other integer. For many if not most calculations, 1-based indexing is more natural.

      (9) The basic array syntax of

      x(i,j,k)

      in Fortran is more readable than the awkward

      x[i][j][k]

      of C/C++

      Fortran rules!

    32. Re:hardly unfortunate by eraserewind · · Score: 1
      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.
      There is a way around this. Write a function:

      void *multidimensionalarray(int numdimensions, ...);

      It's quite easy to make that function malloc enough space for both the data area and assorted levels of pointers in a single block. Then you set up all the pointers, so that they all point to the correct place. From there you can index the array as if it were truly multidimensional.

      int ***my3darray = 0;

      my3darray = multidimensionalarray (3, 10, 20, 30);

      my3darray[1][4][9] = 1; // etc....

      Of course it consumes quite a bit more memory than a real array, but it does work.
    33. Re:hardly unfortunate by Mr2001 · · Score: 2, Informative

      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]

      I'm pretty sure GCC lets you do that, doesn't it?

      --
      Visual IRC: Fast. Powerful. Free.
    34. Re:hardly unfortunate by coats · · Score: 1
      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.
      It is a matter of record that during the early phases of gcc and development, Craig Burley had an enormous problem convinding Richard Stallman that a family of optimizations associated with "true" arrays were worthwhile, and in fact necessary for the back end of the system. Once they were put in, performance was approximately doubled for a broad range of Fortran codes.

      And you're telling me that all this hand-optimization can be done by a routine "good" programmer, when one of the premier C programmers of the age couldn't see its value ?!

      --
      "My opinions are my own, and I've got *lots* of them!"
    35. Re:hardly unfortunate by coats · · Score: 1
      How long has C had
      void foo( int m, int n, double a[n][m] )
      Sorry, arrays aren't "first-class citizens" in C.

      My complaint is that until F03 comes out fully supported by the vendors, struct/TYPEs aren't quite first class citizens in Fortran, as exemplified by the following

      TYPE bar
      INTEGER m
      INTEGER n
      REAL a(M,n)
      END TYPE

      fwiw

      --
      "My opinions are my own, and I've got *lots* of them!"
    36. Re:hardly unfortunate by Nevyn · · Score: 1
      It's worse than that, the above code isn't std. C (Ie. portable). You can often get away with it, due to the way the compilers layout the arrays ... but for C the only way you can do it is with:
      . for (i = 0; i < 4; i++) /* skipping one */
      . . for (j = 0; j < 10; j++)
      . . {
      . . . x[i][j] = '\n';
      . . }
      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
    37. Re:hardly unfortunate by armb · · Score: 1

      But then you are back into the extra dereferences not allowing the compiler to be as aggressive with optimization as with the Fortran version.

      --
      rant
    38. Re:hardly unfortunate by Rei · · Score: 1

      You didn't seem to be comparing fortran to C++ - you seemed to be comparing it to C.

      *

      1) No, it's not - you can use valarray from the std package alone, and you don't even need to allocate memory. As for the multidimensional aspects, you can use gslice, direct address computation, or subclass it, if you want to use the basic valarray type. For more ease of use, there are premade subclasses, like boost's MultiArray, and especially Blitz++ (a library designed to provide fortran-style arrays with similar performance). Blitz++ is probably the easiest - you can do code like:

      Array A(3,3), B(3,3), C(3,3);

      A = 1, 0, 0,
      2, 2, 2,
      1, 0, 0;

      B = 0, 0, 7,
      0, 8, 0,
      9, 9, 9;

      C = A + B;

      cout "A = " A endl
      "B = " B endl
      "C = " C endl;

      (2) Same with all three arrays that I listed, on all counts. Plus, you have the option to have the array duplicated in the pass or to pass the actual array that you're currently working with, depending on whether you use an & in front of the type name in the function call's arguments.

      (3) Once again, you're not talking about C++, you're talking about C. All of the classes that I mentioned allow for that.

      (4) You mean like (valarray):

      y=x.sum();

      I'm not sure what you're doing in the other two lines, as I don't know Fortran, but I have little doubt that you can do it in C++ quite easily. Are you summing a particular dimension? You can do any operation on a slice made using gslice, i.e.,

      y=x[gslice(0,len,stride)].sum()

      If you subclass (or use a premade subclass, like boost's), you don't even need to keep your len and stride or use gslice. In boost's MultiArray, if you wanted the sum of, say, dimension 1 from 3 to 8, dimension 2 from 1 to 6, and dimension 3 from 0 to 4, I believe you would do:

      y=x[indices[range(3,8)][range(1,6)][range(0,4)]] .s um()

      (this assumes that you're using namespace boost and have done typedef array_type::index_range range;)

      In Blitz++, you would use:

      y=sum(x(Range(3,8),Range(1,6),Range(0,4)));

      (5) Already covered. You can assign to them and everything.

      (6) Just as you can in C++.

      (7) Wrong. One word: templates. You template a class, use it as your basic type for the array, and you're all set.

      You're thinking in C-mode, not C++ mode.

      (8) Again, they can in Blitz++, and you can mimic it with your slicing in std::valarray. As I mentioned earlier, blitz++ has probably the cleanest implementation - it's very nice, full featured, very fast, and is a great testament to how truly expandable C++ is.

      (9) I disagree (because that makes it look like a function call), but you can use both methods natively in blitz++, and you can subclass either of the former two methods to allow for that notation.

      "Fortran rules!" - Only when you don't know the thing you're comparing it to.

      --
      We also have a halon fire extinguisher. Its always nice to have a fire extinguisher that kills people around.
  69. Even more scary? by Sycraft-fu · · Score: 2, Interesting

    There is Visual Fortran and Fortran .NET. Visual Fortran I've actually seen and installed on a computer. Watching one of the grad students start to write a Windows program, with GUI, in Fortran was rather scary. I haven't messed with Fortran .NET but apparantly you can really generate .NET code with it. This also mean that one could write stuff in Fortran and call it from C++. To make things even scarier, there's a PERL .NET kit. So one could write a PERL program that calls on Fortran.

    These are things man was not meant to do :)

  70. Re:Ah... But which notation is clearer? by Aardpig · · Score: 1

    Fortran has accepted A==B as an equivalence test since 1990. But it is still immune from the C programming pitfall, since A=B can never appear in an evaluation context.

    --
    Tubal-Cain smokes the white owl.
  71. bane of my existance by SQLz · · Score: 1

    My boss still has 'habits' from FORTRAN while coding C.. Basically, we all work late to make sure we never fall behind on a project because if we do he starts coding. He han an uncanny skill of only using the variables i,j, and k for eveything, over and over and over again.

  72. 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.
    1. Re:FORTRAN gets its bad reputation... by Aardpig · · Score: 1

      Maybe what we should do is require scientists and engineers to pair-program with recent CS graduates.

      Why? I'm a scientist who programs in Fortran on a daily basis. Rather than having a script-kiddie CS graduate hovering over my shoulder and telling me C++ is better than Fortran, I'd far rather have a copy of Knuth on my desk. Which I do.

      Having said that, you go and dig out a book on numerical methods, and you'll find that more of them are written by physicists, mathematicians and engineers, than by computer scientists.

      --
      Tubal-Cain smokes the white owl.
    2. Re:FORTRAN gets its bad reputation... by alispguru · · Score: 1

      I'm a scientist who programs in Fortran on a daily basis. ... I'd far rather have a copy of Knuth on my desk. Which I do.

      You are clearly not a member of the majority class I was describing. I was thinking more of the people who write stuff like:

      INTEGER*1 PARTS(4)
      INTEGER*4 WHOLE
      EQUIVALENCE PARTS, WHOLE

      and don't understand why this is a bad idea in portable code.

      My current task involves taking huge lumps of code for processing satellite science data and porting them from their native environement (big iron SGI) to x86/linux. I've seen code ranging from multiple pre-compiled binaries with Perl drivers that automatically do the right thing on different platforms, to code like the above, with lots of stuff inbetween. Scary...
      --

      To a Lisp hacker, XML is S-expressions in drag.
    3. Re:FORTRAN gets its bad reputation... by TeknoHog · · Score: 1
      Very interesting! You just named the reasons why I think Fortran (90+) is the one of the best languages out there. Then again I'm a scientist :)

      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.

      I actually learned Perl by pair-programming with a CS guy, though nothing good came of that ;)

      --
      Escher was the first MC and Giger invented the HR department.
    4. Re:FORTRAN gets its bad reputation... by Anonymous Coward · · Score: 1, Interesting

      as of this May I will have a B.S. in astronomy, and my Husband will have a B.S. in CS. We spend a lot of time talking about languages, and about the calculations done in astronomy. I think there are two reasons fortran has stayed around for as long as it has. #1. It matches how Physists and Astronomers think. Even though other languages may be prettier or easier to use or whatever, Fortran is still easier for us to pick up than just about anything else. And #2 we like things to be hard and icky. There is only one reason anyone gets any degree in Physics or Astronomy, and that is because they want people to know they are smart. And what do smart people do? Hard things that no one else can run or understand, or enjoy looking at. (Ask any astronomer about IRAF and then you'll know exactly what I mean.) For some reason Fortran makes us feel smart. It's like candy for our egos.

    5. Re:FORTRAN gets its bad reputation... by wintermind · · Score: 1

      As a scientist guilty of many offenses to good programming form and style in several languages I agree that there is a lot of truth to this. I would emphasize, though, that as a scientist I am producing code to support my research, not to sell to someone. There is a presumption on my part that anyone else using my code has either similar knowledge to my own or is willing to invest the time and energy to acquire similar skills. A good example is my pedigree analysis software, PyPedal -- I have had some enquiries from potential end-users. Some people I tell, "Go for it!", others I tell, "I do not think that this is a good tool for you." I do not do that out of arrogance, but rather in recognition of the fact that I simply cannot provide an appropriate level of support to users who are not comfortable with installing Python, writing what are simple-to-me scripts, and digging through jargon-laden output files that do not conform to a consistent style. The flaws of m program are not the fault of the user, but I certainly try and not mislead people.

      Many of the applications that we use at work are home-grown or colleague-grown Fortran. We produce national genetic evaluations four times a year for lots of traits in six breeds. Like Fortran or hate it, we have not missed a release date in 25 years. As always, use the right tool for the job.

    6. Re:FORTRAN gets its bad reputation... by alispguru · · Score: 1

      And #2 we like things to be hard and icky.

      This is an example of the worse-is-better phenomenon, which attempts to explain why elegant stuff fails in the marketplace, and crufty stuff succeeds.
      --

      To a Lisp hacker, XML is S-expressions in drag.
    7. Re:FORTRAN gets its bad reputation... by 4of12 · · Score: 1

      I wrote FORTRAN77 for more than a decade for numerical applications. Where FORTRAN really got to be a pain was in text processing, parsing input, trying to control devices like displays, etc.

      I haven't kept up with FORTRAN90, 95 and the later variants because I learned C (and then C++) and didn't see a reason to learn an improved FORTRAN that was essentially trying to make up for what the other languages already had.

      FORTRAN is a great efficient language for numerical processing, but I think it should be considered like assembly, as modules (just as the fastest BLAS implementations are not FORTRAN, but assembly) that can be accessed from a higher level language like Python.

      --
      "Provided by the management for your protection."
  73. I was offended too by Anonymous Coward · · Score: 0
    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.


    It irritated the hell out of me too. The ACM Queue editors should have told him to modify the examples before posting it on their Web Site.

    In the end, it's really the fault of the editors. This article is a fine example of "How Not to Write a Programming Article for a Technical Audience."

  74. It worked well for rocket exhaust analysis though! by bobalu · · Score: 1

    Not that I can confirm or deny that those printouts had "MX" and "SHUTTLE" written on the side. :-)

    --
    The revolution will NOT be televised.
  75. Oh my god, it's Fortran week (THX 1138) by 14erCleaner · · Score: 1
    I got my start in programming in the late 70's, writing Fortran code on punch cards in college. Later, I spent a long period doing Fortran compilers and Fortran programming tools, so I'm kind of a Fortran expert.

    I thought those days were long behind me, but then...

    This week, I got the new DVD release of the 1970 movie "THX 1138" from the local library; you know, George Lucas' college project about a dystopian future, that set him on his way to fame and fortune. Pretty bad movie, although I did like the "somebody ran over a Wookie" line in the background police chatter.

    But the funniest part was when they wanted to show some "computer" stuff (this movie was from 1970, remember). They showed....Fortran code! Printed on green-and-white line-printer paper! Ohmigod, deja vu! And now, today, we get this story! AAAAAAAAAGH! It won't die!

    --
    Have you read my blog lately?
  76. Re:Ah... But which notation is clearer? by Richard+Steiner · · Score: 1

    We're still using F77 here, so I didn't know that. :-)

    That and C's strange /* comment notation */ are two things about C that I've never quite understood...

    Maybe I've been using too many non-C-like languages for my own good. :-)

    --
    Mainframe/UNIX Bit Twiddler and long time Windows/Linux Hobbyist.
    The Theorem Theorem: If If, Then Then.
  77. Do you old fortran programmers remember... by museumpeace · · Score: 1
    This bit of code...some compilers would let it go...and YOU'd have to figure out what the heck went wrong.
    • integer i, n, sum

    • sum = 1
      d0 18 i = 1, n
      sum = sum + i
      write(*,*) 'i =', i
      write(*,*) 'sum =', sum
    18 continue
    ..yup, not just an ugly language, but dangerous as a buzzsaw with no guards or kill switches.
    --
    SLASHDOT: news for people who can't concentrate on work or have no life at all and got tired of yelling back at the TV.
    1. Re:Do you old fortran programmers remember... by ratboy666 · · Score: 1

      To all the young un's out there:

      FORTRAN doesn't use space to delimit tokens:

      d0 18 i = 1, n

      is not a DO statement (intended), but is:

      D018I = 1, N

      An assignment to D018I, which is a REAL (implicitly created).

      the following "," is then an error, which most compilers would catch, as a bad assignment statement.

      And THAT'S THE WAY WE LIKED IT.

      Ratboy.

      --
      Just another "Cubible(sic) Joe" 2 17 3061
    2. Re:Do you old fortran programmers remember... by Smooth+Hound · · Score: 1
      int x[5];
      x[5]++;
      Every compiler will let it go... yup, not just an ugly language, but dangerous as a buzzsaw with no guards or kill switches.
    3. Re:Do you old fortran programmers remember... by museumpeace · · Score: 1

      actually, if you tried the equivalent in Ada, you'd get your wrist slapped for the x[5] because Ada does array bounds checking. I dont know if it would raise the error at compile time but, as coded, the 5 is static so at least the info is present and a mechanism for checking....gawd I hate ada!

      --
      SLASHDOT: news for people who can't concentrate on work or have no life at all and got tired of yelling back at the TV.
  78. I hate Fortran by idiot900 · · Score: 1

    I spent several weeks last summer trying to make a simple modification to a molecular simulation package. This package is about as old as Fortran itself and the primary (basically only) programmer is not a computer scientist. It was hell. I just barely got to the point where I could add my 20 lines - in six weeks. And I'm not a bad coder.

    Along the way, I discovered many horrible things about Fortran-77:

    - No dynamic allocation
    - Mind-bendingly stupid global variable mechanism (COMMON blocks)
    - Back in the day, identifier names were limited to something like six characters. Tens of thousands of lines of code later, it's anybody's guess as to what a given variable or function does.

    I feel terrible for you folks who had to deal with this horrible language back in the day.

    The only saving grace is the (very nice) guy who wrote has his office down the hall from me, so I could pester him with questions. Otherwise, I would have been completely sunk.

    1. Re:I hate Fortran by rnturn · · Score: 1

      Ah... but COMMON was only nasty (IMNSHO) when you depended on unnamed COMMON blocks. By using named COMMON you could restrict what subroutines had access to what variables. With a little care, you could avoid the general confusion that resulted when folks got lazy and stashed everything in an unnamed COMMON block. Debugging one of these programs could be was particularly nasty and I tended to frown a lot when people handed me a listing looking for my help and I noticed in the compiler listing that nearly all the variables were listed as being in unnamed COMMON.

      And on some OSes (RSX-11M-PLUS was one of these), you passed data between separate processes via what looked to FORTRAN as a named COMMON block. Back in my FORTRAN days, I had written some large simulations that ran on a big RSX system where a couple of dozen different programs passed data among themselves via these chunks of shared memory. It was actually a piece that you wrote in MACRO-11 and loaded into memory before starting the FORTRAN tasks. I'm trying to remember what is was called now. Global section or was that the VMS equivalent? Darned cobwebs obscuring things and my RSX Executive reference is buried down in the basement. :-)

      The six-character variable name makes me think that the code was written for a pretty old compiler. I recall the IBM FORTG and FORTH compilers having this limit. I remember finding the switch to DEC machines and using their compilers quite liberating. (Not to mention I didn't have to deal with XEDIT any more.)

      As for having to deal with someone's really old software... I know what you're going through. An office mate left behind some code that we were to use in a later project. While he was working on it, he'd asked my advice on how to make it easier to manage as he'd just been plugging away and the thing grew to be a spaghetti code monster filled with GOTOs. He slaved away on it and was pretty satisfied with himself. When he left and I got the listings to begin on the followup project. I found that all he'd really accomplished was to pull out about a page and a half that became the main program. The remainder of the 27 pages or so became one giant subroutine. My job was to pull the guts of this hideous thing out and run it on a PDP-11. Finally got it to work but it took just a little doing. Ever since I've really loathed having to work on someone else's code. In the end, though, it does feel sort of good getting that old rat's nest of code cleaned up and the needed changes incorporated.

      --
      CUR ALLOC 20195.....5804M
    2. Re:I hate Fortran by idiot900 · · Score: 1

      Actually, the COMMON blocks in question were named. I call them stupid because it seems you have to include them in every subroutine that wants to use them. Also, as I understand it, the order of the variables within the block matters.

      COMMON /STUFF/ FOO, BAR ...
      COMMON /STUFF/ BAR, FOO

      So BAR references the same memory as FOO now. (Sorry if syntax is wrong, I'm actively trying to forget the language, but you get the gist)

      On another note, this package also has a subroutine to test whether the constant 0 really is equal to zero, and whether the constant 1 really is equal to one. There apparently was a bug in some compiler where if you did the wrong thing, you could actually redefine constants!

  79. Re:Ah... But which notation is clearer? by Aardpig · · Score: 2, Insightful

    We're still using F77 here, so I didn't know that. :-)

    Fortran 90/95/2003 are well worth 'upgrading' to -- for starters, the array syntax is fantastic. If A and B are arrays, you can assign from one to another simply by 'A=B'. Likewise, 'A=sin(B)' would set each element of A to the sine of the corresponding element of B. Code like this is a doddle to parallelize automatically, enabling one to write parallel code with very little effort.

    --
    Tubal-Cain smokes the white owl.
  80. OT:any irc channel for fortran? by Anonymous Coward · · Score: 0

    Hi,
    I have just started working in fortran and finding it damn ugly (foo has a C background). I was wondering if there is any irc channel where i can get help on fortran language.

    To start with, how do i allocate space for dynamic strings. I have to store the 'Current working directory' in a variable. I do a

    INTEGER getcwd, status
    CHARACTER*64 CURRDIR
    status=getcwd(STATUS)

    and what i get is the current path in CURRDIR, padded with a lot of empty spaces at the end. How do i get rid of the spaces???? How do i create a dynamic strings with varying lengths?

    Cheers

  81. The new version of the joke should be: by Tumbleweed · · Score: 1

    "Don't write perl." :)

    Fortran-77 was the bane of my college existence. *shudder*

  82. fortran style java by peter303 · · Score: 1

    I have seen people write a program consisting on a single C++ or Java class that is the entire program. Sometimes it is a single method- main. It may e hundreds of lines long and use only primitive data types. No concept of data abstraction through classes at all.

  83. Re:Ah... But which notation is clearer? by Richard+Steiner · · Score: 1

    I'm not sure if there's even an F90 compiler available for this particular environment (basic mode HVTIP/USAS on a Unisys 2200/500).

    --
    Mainframe/UNIX Bit Twiddler and long time Windows/Linux Hobbyist.
    The Theorem Theorem: If If, Then Then.
  84. Article is just a variation on an old proverb by istartedi · · Score: 1

    There is one true coding style, and everybody codes in it.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  85. Re:fool! ...AND *YOU* MEAN... by Nom+du+Keyboard · · Score: 1
    You mean "sure to p .divide. o Fortran programmers.

    And you mean...

    "sure to P .DIVIDE. O Fortran programmers.

    --
    "It's the height of ridiculousness to say for those 9 lines you get hundreds of millions."
  86. Correctness of Code in Fortran Was Provable by HiyaPower · · Score: 1

    in the mathematical sense of proof.

    Sorry, but you cannot say the same about a lot of the languages that exist these days.

  87. Fortran 2003 by hey · · Score: 1

    Wow, Fortran 2003 has OOP and asynchronous I/O.
    Pretty cool.

  88. Exactly what I've been saying... by gillbates · · Score: 1
    Just because a programming language allows you to write bad code doesn?t mean that you have to do it.

    I've often advocated the use of assembly language, and every time I do, the flames begin:

    • It seems as if some people can't understand concepts such as modularity and object oriented coding. They think that assembly can't be done in an object oriented manner, in spite of the fact that their compiler converts C++ into assembly during compilation.
    • Then there are those who can't understand that maintainable, readable code can be written in assembly - they're apparently so used to not commenting their code that they just can't see an assembly programmer doing it. Nor can they understand how an assembly programmer will break a complex task up into discrete functions and use those to accomplish a more difficult task.

    Now, I realize there's probably some pretty ugly assembly code out there. But when you look at what an idiot programmer can do in other languages, it doesn't seem so bad:

    • A clueless coder need only write one function in C and C++: main().
    • Imagine a Java enterprise app with only one class. Yes, it's legal Java!

    So often times we are quick to blame the language for what is really ineptitude on the part of programmers. A good programmer will write good code in any language, but a poor programmer requires a specific language in order to write good code. And a malicious programmer can write bad code in any language...

    --
    The society for a thought-free internet welcomes you.
  89. Well... by Locke2005 · · Score: 2, Insightful

    As somebody that has been programing for 25 years, all I can say with regard to this article is "Well, duh! Tell me something I don't already know!" Seriously, if you've been programming for more than 3 years and haven't already figured out by yourself (and by bad example) how to write understandable code, maybe you shouldn't be programming!

    --
    I've abandoned my search for truth; now I'm just looking for some useful delusions.
    1. Re:Well... by seminumerical · · Score: 1
      It was possible, even easy, to have included pointers and recursion in FORTRAN II in the late 1950's. They were deliberately excluded, on the theory that they were too complicated for the end user (engineers and scientists). Anyway, why shouldn't FORTRAN have been a general-purpose programming language as well as biased towards scientific calculations? They aren't mutually exclusive. Forget abstract data types, why couldn't they have at least added records to the language in the 60's when the need for them became obvious? Think of the millions of man hours that would have saved by not cramming variables into Common blocks and computing the length of the "record" by multiplying each variable by its size in bytes in the underlying hardware (and try porting that from a 6 bit byte machine to an 8 bit machine).

      I think the reason was that FORTRAN became the language for the grad student who was only going to learn one language in his life. After his mind closed (growth of brain ceases at around age 25) he wasn't going to learn any damn fancy new features like while-do or lists. Real men use gotos and arrays for everything. New features were added to the language so incredibly slowly that many a young mind was ruined by 25 (hehe).

      You wouldn't believe the weird outbursts I've heard from two middle aged professors of engineering about the superiority of FORTRAN. The true motive of the outburst is always easy to understand: an unwillingness to be exposed to anything new in case it exposes them as being not as robotically intelligent as they imagine themselves.

      --
      In wartime... truth is so precious that she should always be attended by a bodyguard of lies. (Churchill)
  90. Why We Hate Fortran by imkonen · · Score: 1
    I suspect there are a lot of younger (non-computer) scientists like myself who hate Fortran not because it's inherently a bad language, but because we've been exposed to more bad code in Fortran than any other language. I hear a lot of people defending Fortran because it's got newer standards that make it look more like C, but it's the shitty programs written by bad programmers we mostly see.

    All that said, though, I still think it's an ugly language. And I think there is something to be said for a programming language preventing some bad programming habits simply by not having any support for GOTOs.

    Also digressing a little from my first point...did anybody else notice the irony of an article about clarity in programming posting code examples in a .jpg?

    1. Re:Why We Hate Fortran by norkakn · · Score: 1

      gotos are great!, They accurately reflect what the processor actually does. Screw this abstraction stuff, make people learn how to use a computer's strengths instead of writing in some horrid POS like Java or Perl

    2. Re:Why We Hate Fortran by Mr.+Byaninch · · Score: 0
      gotos are sometimes the best way out of a situation you've designed your way into, but a well-designed procedure does not need them.

      Frankly, I'm surprised anyone here would champion gotos. Us old farts had to use them back when languages didn't lend themselves to well structured design. That was a long time ago.

      I have a hard time trying to understand your statement "They accurately reflect what the processor actually does". Uh, the processor only does what it's told to do. By the time it gets to "the processor", the goto isn't any different than any of the other instructions it receives. But how the programmer caused that to happen can vary from a poorly coded module that jumps all over the place, to one that does alter the flow of execution, but not by dictating exactly to where it goes, rather, it specifies what function it wants to happen next.

      Can you give us an example or two of modern languages (or even ancient ones) that give coders a way to "use a computer's strength instead of writing in some horrid POS like Java or Perl"? Machine language comes to mind, but, criminey, who writes that any more?

      Back when I was programming an Apple II, your statement made sense. But it was never the "computers's strengths", it was the programmer's skills. Has that changed for you?

      --
      Sig not available, please try again later. If the problem persists, then the submitter is an idiot.
    3. Re:Why We Hate Fortran by norkakn · · Score: 1

      I was mostly being sarcastic, but I was also referring to coding assembly or writing C for crappy embedded platforms where one has to debug at the aseembly level, so it is nice to have a language that maps directly to assembly.

      The other side of it is that from a designer view, architects hate programmers because very few these days understand how computers actually work and so they do not understand what things are hard for computeres and what things are easy. When things are abstracted as far as perl, it allows a good programmer to write code much more easily, but it also allows a bad programmer to hog a P4 to be able to write a program that could run fine on a 8080 if written in assembly.

  91. Re:Oy.. The code I've seen.. by FuzzyBad-Mofo · · Score: 1

    Ever see a BASIC program from the 8-bit computer days? This kind of crap was quite common:

    10 FORM=.TO11:?LEFT$("BASIC SUCKS",M):NEXT
  92. FORTRAN in Python by Russ+Nelson · · Score: 1

    #!/usr/bin/python

    import sys

    i = 0
    k = 1
    ary = []
    ary.append(None)
    while ( i != 0 ):
    inl = sys.stdin.readline()
    if inl:
    j = int(inl)
    ary.append(j)
    k = k + 1
    else:
    i = 0

    j = 1
    while (j k):
    print ary[j]

    --
    Don't piss off The Angry Economist
  93. Gopher colony by rumblin'rabbit · · Score: 1
    Now that's a unfair. The FFT is notoriously difficult to understand for such a short algorithm. I admit, however, that the programming style is not helping here. And it looks like the "Numerical Recipes" version too.

    Now to really obfuscate the code, you want alternate returns and assigned goto's. Control keeps popping up in all sorts of unexpected places. It's like watching a colony of gophers.

  94. I hate Fortran (an old fogey responds) :-) by Richard+Steiner · · Score: 1

    > No dynamic allocation

    In the mainframe transaction environment I write Fortran code for, it's still true.

    While it isn't a good thing from some people's perspective, think about it this way: memory leaks induced by application programmers become nonexistent, and a machine with virtual memory is doing to dynamically page the process in and out at the OS's whim anyway so the fixed sizes seen by the applications programmer in that environment don't really matter all that much.

    Each module I create is limited to roughly 262K words of memory. It may or may not use it, and it really doesn't matter to me. All I have to care about is getting the thing to compile! :-)

    > Mind-bendingly stupid global variable mechanism (COMMON blocks)

    We don't use those. It's easier to map common areas to a memory file and INCLUDE a PROC with relevant DEFINE names.

    > Back in the day, identifier names were limited of something like six characters. Tens of
    > thousands of lines of code later, it's anybody's guess as to what a given variable or function does.

    Here's a new term for you: "naming convention" :-)

    Where I used to work, the convention commonly followed was this:

    * External refererences (usually defines for fields in a file) were six characters, with the first two indicating the subapplication code, the third being the file, and the last four being used for the field itself.

    * Local references were usually five characters, but loop counters could be one-character.

    It wasn't all that hard to learn that anything that was WXSxxx belonged to the Weather Station Record, WXGxxx to the Weather Grid record, etc., and LOOOP was a local loop counter.

    Some defines (e.g., WXGLEN or WXGVER) are actually quite obvious (the WX Grid Record record length and version number respectively).

    > I feel terrible for you folks who had to deal with this horrible language back in the day.

    I feel terrible for you folks who have to type in 40-character mixed-case variable names when we are able to save both time and typos. :-)

    --
    Mainframe/UNIX Bit Twiddler and long time Windows/Linux Hobbyist.
    The Theorem Theorem: If If, Then Then.
  95. Andy Rooney by trailerparkcassanova · · Score: 1

    Have you ever wondered why there is all this bad code? I have. First I blamed it on the dog since everyone knows the dog is the first to blame. But the dog died a few years ago so I can't blame it on him anymore. I needed something else. So I started blaming it on that other guy. You know the one I'm talking about. Him, your predecessor, the one who came before you. The guy you never knew but everyone talks about. Yeah, that guy..(insert more Andy Rooney blah-blah here)....I really miss that dog.

  96. Re:Ah... But which notation is clearer? by Pxtl · · Score: 1

    Neither. This is one place where Pascal and its bretherine win - A := B or A = B. Assignment is not equality, and the notation should not be such.

    Still, I prefer C's brackets or Python's colons and bracing to Pascal-style "begin" and "end" statements.

  97. What's wrong with historical examples? by tetromino · · Score: 1

    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.

    Why is using Bush/WMD's as an example any worse than, say, mentioning the Gallipoli operation, Kennedy's attempts to unseat Castro, Japan's 1592 invasion of Korea, the design of the RBMK nuclear reactor (Chernobyl), the US war on drugs, or any other case of a major world power majorly fucking up? Bush's search-for-WMD debacle is a fact, regardless of your political leanings, and it will stay in the history books for at least a century.

    Saying that G.W.Bush is an imperialist monkeyboy = gauche. Saying that there are no WMD's in Iraq = fact. See the difference?

    1. Re:What's wrong with historical examples? by Anonymous Coward · · Score: 0

      -- Saying that G.W.Bush is an imperialist monkeyboy = gauche. Saying that there are no WMD's in Iraq = fact. See the difference?

      No I don't see the difference. The actual fact is that the search for WMDs gave no results. Thus, since there was no proof, the point was only conceded.

      If you were to loose some change in your couch and later went to look for it and failed to find it, would you conclude that the change never existed?

      You would likely conclude that you couldn't find it. Not that it doesn't exist.

      Haven't any other programmers heard of a tri-state condition? (true, false, and null) The result is null, and cannot be equated to true or false.

      This is the mis-conception that upsets some right wing nutjobs...like me.

      And for the actual uses of Fortran, it's a reasonable language. I've done my share of coding in it.

    2. Re:What's wrong with historical examples? by FungiFromYuggoth · · Score: 1

      Um, no. If we exclude magical faeries from the tri-state condition (and unsupported rumors about Syria fall into the magical faeries category), we are left with: 1. The US said there were WMDs in Iraq 2. The UN weapons inspectors could not find them 3. The US invaded, and could not find any WMDs more recent than a few castoffs from the Iran-Iraq war. 4. Right-wing loonies refuse to admit they were wrong. No one ever claimed there never -were- WMDs. (Although, to be fair, during the 80s right-wing loonies blamed the gassing of the Kurds on the Iranians.) A better analogy would be: you know that, at one point, there was change in the couch. You ask the owner of the house, who tells you he took the change and threw it away. No one saw him throw it away, so there is no proof. You send in couch inspectors, who fail to find change. So you blow open his front door, shoot a few family members, and break the couch into kindling while his neighbors loot his living room. Upon finding no change, you decide that the result "cannot be equated to true or false".

  98. 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.

    1. Re:GPL by cimetmc · · Score: 1

      I think the G95 author was clever enough to due his source code ahcnegs such that there is no GPL violation. The G95 source code is human readable without problems.
      What the author has done is changes that make it near impossible to track changes to the source code:

      - there is no changelog
      - whitespace is randomly added to the code
      - variable names are randomly changed

      The last 2 kind of operations make it impossible to do diffs between different versions as the actual changes get burried in the noise created by the whitespace and variable name changes.

      Marcel

  99. Why do programmers hate vowels? by Ricdude · · Score: 1

    Is tmp really any more meaningful than temp? pnt vs. point?

    As long as programmers remember that source code is not for the computer to understand, but for *programmers* to understand, those of us who get paid to fix broken code will have a much less stressful life...

    --
    How's my programming? Call 1-800-DEV-NULL
    1. Re:Why do programmers hate vowels? by Anonymous Coward · · Score: 0

      You answered your own question in your subject line: source code is for programmers to understand and programmers 'hate vowels.'

      BTW, the shorthand for pointer is ptr. It always has been.

    2. Re:Why do programmers hate vowels? by Ricdude · · Score: 1

      But a pointer to what, exactly?

      --
      How's my programming? Call 1-800-DEV-NULL
    3. Re:Why do programmers hate vowels? by Mr.+Byaninch · · Score: 0

      I once had to deal with a program where permanent changes were referred to as PMT and temporary ones (this exectuion only) as TMP. TMP and PMT? Now there's some readability. Almost induces lysdexia.

      --
      Sig not available, please try again later. If the problem persists, then the submitter is an idiot.
  100. Matlab and Mathematica? by Anonymous Coward · · Score: 0

    Matlab and Mathematica are being used in my school instead of fortran, only one (the oldest one) of my teachers uses Fortran, and believe me, he writes really ugly code.

    We used Matlab for doing matrix calulations in our Linear Algebra Class, and with other teacher we learnt to use Mathematica for solving a lot of complicated problems. It's really easy to get problems solved in matlab or mathematica. Yes, fortran is much smaller and runs in a 386, but many of my classmates don't even know how fast a 386 is, we all have at least 800Mhz CPU's and all of our teachers have >1.5Ghz computers.

    BTW: im alephdelta but i lost my passwd and slashdot's Turing Test keeps thinking i'm a machine. So i cannot get it back.

  101. Re:Why FORTRAN makes people think FORTRAN-66 (or 7 by Anonymous Coward · · Score: 0

    I have a FORTRAN90 compiler which pretends to play well with my old VisualStudio6.0 (yes, a M$ product) IDE/linker/debugger. Theoretically, you can write a C++ program that calls FORTRAN .dll-s, with little effort... if you're willing to throw in about 20 #pragma preprocessor commands, untangle name mangling, &c.
    I've found that it's easier to just rewrite the old FORTRAN code in C++. I've even noticed performance *gains* when rewriting the code ('course, I do throw in some inline ASM, but...)

  102. Fortran is heavily used at some airlines. by Richard+Steiner · · Score: 1

    People seem to like writing flight planning systems in Fortran, and we had several other major systems written in Fortran when I worked for an airline. Even the "modern" Unix-based system that replaced one of the mainframe systems while I was there had Fortran 66 code at its core.

    Airlines were one of the first areas of industry to use computing heavily and are still using many older specialized applications, so that might explain the continued use of (and development in) that language.

    --
    Mainframe/UNIX Bit Twiddler and long time Windows/Linux Hobbyist.
    The Theorem Theorem: If If, Then Then.
  103. Well... by tetabiate · · Score: 2, Insightful

    FORTRAN (FORmula TRANslation) was never meant to be a general-purpose programming language, it is strongly biased towards scientific calculations. It has native support for doing fast computations with scalars and arrays of integer, real and complex data types. In modern revisions of the language (F90/95, Fortran 2000/2003) it gained support for dynamic memory allocation (although there is no garbage collection), abstract data types, pointers and object-oriented programming but few people use these capabilities. And yes, it is possible to write beautiful programs in FORTRAN although bad practices prevail due to the backwards capability of modern FORTRAN with F66/F77.

  104. real programmers by k-zed · · Score: 1

    Real programmers can (and do) write FORTRAN in any language. (And they aren't afraid of goto)

    --
    we discovered a new way to think.
  105. Re:I hate Fortran (an old fogey responds) :-) by CrosseyedPainless · · Score: 1

    Between this thread, and your sig, I feel an urge (buried for decades) to type @FTN,CS PROGNAME....

  106. bust a spammer by Anonymous Coward · · Score: 0

    Here's a spamer sending to a private email list and he shows his phone number. *67 your phone (hides your # from caller id) and talk to this guy about the juice he sells. have fun!

    http://groups.yahoo.com/group/manila-dev/message /9 78

    1. Re:bust a spammer by Mr.+Byaninch · · Score: 0

      How come nobody's mod'd this?

      --
      Sig not available, please try again later. If the problem persists, then the submitter is an idiot.
  107. Re:Oy.. The code I've seen.. by ackthpt · · Score: 1
    10 FORM=.TO11:?LEFT$("BASIC SUCKS",M):NEXT

    Yes. Back when we had 8K or 12K to program in.

    When I programmed in RSTS Basic I rarely had more than one statement per line.

    The worst of that cramped coding style was when you had to debug someone elses program. It took considerable time simply to determine what it was doing. I've still had to cope with things like that a few times over the years and usually bring it up in a text editor and split out individual statements and to show where nesting is taking place.

    --

    A feeling of having made the same mistake before: Deja Foobar
  108. Re:Why FORTRAN makes people think FORTRAN-66 (or 7 by Anonymous Coward · · Score: 0

    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.

    You're lucky. When I hear "FORTRAN", I think "FORTRAN IV", and I'm unfortunately usually right.

    At least my predecessor at this job took care of all the pre-FORTRAN IV crap...

  109. Fortan and C arrays by foog · · Score: 1

    Yes, it's tricky at an "intermediate C programming" level to do fast multidimensional arrays in C, but it's not at all impossible.

    Look at how cblas does it, if you can't figure it out on your own like I had to back in the day.

  110. origami... by slew · · Score: 1

    I still think for beautiful code, you can't beat a folding editor...

    And no, the emacs folding editor macros aren't quite the same thing...

    1. Re:origami... by yarbo · · Score: 1

      vim can do code folding

  111. white space isn' t your problem by hikerhat · · Score: 2, Insightful
    The article is basically some guy who has a hard time reading code and blamesItOn trivial_things like whiteSpace usage and camelCase vs_underscores_. If you're having a hard time understanding code it has nothing to do with little nit picky things like white space and underscores (unless the code has been deliberately obfuscated). It is because:
    1. You don't have enough experience reading/writing code. You have to read (more so than write) a tremendous amount of code to get good at reading code.
    2. You don't understand the problem the code is solving.
    3. The code is very badly designed at a higher level than things like white space and underscores.
    A lot of people get frustrated when they don't understand code right away, and rather than trying to grok why they don't understand it (because 2/3rds of the time it is the reader's fault, not the coders), they just bitch about white space and brace placement. That is never the problem.
    1. Re:white space isn' t your problem by Mr.+Byaninch · · Score: 0
      Your 3 points are 100% right. I agree. Someone who's 'arrrived' at the 'good coder' level and understands anything he or she is presented with has read a lot of other people's code, done a lot of his/her own, and understands that some code does goofy things because the coder was told to do it. Nothing new there.

      But why not leave some clues behind? The people who come after you don't determine your raise or bonus. They're not going to be impressed by obscure and uncommented code. Always assume someone dumber than you will have to figure out what your code does and how it does it. You don't need to dumb down the code. Just explain it.

      --
      Sig not available, please try again later. If the problem persists, then the submitter is an idiot.
    2. Re:white space isn' t your problem by Anonymous Coward · · Score: 1, Funny

      A lot of people get frustrated when they don't understand code right away, and rather than trying to grok why they don't understand it (because 2/3rds of the time it is the reader's fault, not the coders), they just bitch about white space and brace placement. That is never the problem.

      At first, I didn't understand your comment, but I changed the font being used by my browser, and now I get it.

  112. It's a Weed by Nofsck+Ingcloo · · Score: 1

    Back in the 70s I had the priviledge of working with a very bright and skilled compiler designer who happened also to be our company representative to the FORTRAN standards committee. I think his position pretty well summed up the dichotomy between the ugliness and the usefulness of the language: "FORTRAN is a weed. It grows on every computer."

    Ya think it's ugly now? You should have seen it in 1958 when, in its infancy, I spent a summer solving a triple integration problem on a 704! It was ugly, but it worked, and some engineer who got the result made a better jet engine because of it.

    Plus la change....

  113. Re:trouble with math? by Anonymous Coward · · Score: 0

    Repeat after me:

    4:1 means there are 5 things total (4 + 1 = 5).

    a:b means you've got two percentages: a/(a+b) and b/(a+b)

    Using b/(a+b) = p, we can see that b = ap + bp, or b(1-p) = ap, or a/b = (1-p)/p.

    For p=20%, that's (1-20%)/20% = 80%/20% = 4/1.

    For p=25%, that's (1-25%)/25% = 75%/25% = 3/1.

  114. Advantages of Fortran by Eula · · Score: 1

    Fortran can be a great language, generally in applications where the process is more complicated than the data.

    "There's more than one way to do it" is fantastic for stringing a quick script together, but means that different people do things in different ways.

    For big pieces of software, where the source has a long and continuing existence, a lot depends on the capability of one programmer to read and understand what another has written. This can be easier when "there's (barely) only one way to do it".

  115. Pornography? by glasse · · Score: 1

    Did anyone else see this line and do a double-take?

    Like pornography, I know bad code when I see it.

    What? What??

    Ethan

    1. Re:Pornography? by seminumerical · · Score: 1

      In 1964, Justice Potter Stewart tried to explain "hard-core" pornography, or what is obscene, by saying, "I shall not today attempt further to define the kinds of material I understand to be embraced . . . [b]ut I know it when I see it . . . " So, same thing with bad code.

      --
      In wartime... truth is so precious that she should always be attended by a bodyguard of lies. (Churchill)
  116. Multidimensional dereferencing in C: here you go by Pausanias · · Score: 1
    I am not sure I understand what you're saying. Are you saying that it is not possible at all to deference a multidimensional array in C using a[i][j]? That is false.

    Check out the public domain area of the Numerical Recipies package. (While you're at it, you may want to insert your own harangue deriding the routines; but the 2D array routines are solid).

    Returns a matrix with easy multidimensional dereferencing via a[i][j]:
    float **matrix(long nrl, long nrh, long ncl, long nch)
    /* allocate a float matrix with subscript range m[nrl..nrh][ncl..nch] */
    {
    long i, nrow=nrh-nrl+1,ncol=nch-ncl+1;
    float **m;

    /* allocate pointers to rows */
    m=(float **) malloc((size_t)((nrow+NR_END)*sizeof(float*)));
    if (!m) nrerror("allocation failure 1 in matrix()");
    m += NR_END;
    m -= nrl;

    /* allocate rows and set pointers to them */
    m[nrl]=(float *) malloc((size_t)((nrow*ncol+NR_END)*sizeof(float))) ;
    if (!m[nrl]) nrerror("allocation failure 2 in matrix()");
    m[nrl] += NR_END;
    m[nrl] -= ncl;

    for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;

    /* return pointer to array of pointers to rows */
    return m;
    }
    However, if you are saying that somehow C internally dereferences less optimally than Fortran, then perhaps someone else can comment on that---I don't know.
  117. FORTRAN build character by djeaux · · Score: 1
    Sorta like my dad used to say when he'd drag us on a campout in 14 degree weather & a steady downpour...

    My last encounter with FORTRAN was 20 years ago (I translated a FORTRAN program into something prettier) & my only formal training was 30 years ago. But learning FORTRAN is sort of like an old saying I once heard: "First thing every morning if you squeeze a dead mole over your head, nothing worse will happen to you the rest of the day." Learn FORTRAN when you're young & forget it. Nothing else will ever seem as awful. Except possibly p-chem.

    --
    "Obviously, I'm not an IBM computer any more than I'm an ashtray" (Bob Dylan)
  118. You Should Thank FORTRAN... by LighthouseJ · · Score: 1

    Without FORTRAN, what would you use for quick array indices? What I mean is that in FORTRAN, variables with one letter are assigned automatic types if they aren't explicity declared as something else. The letter 'i' happened to be the start of the integer letters.

    What, 'i' is just the first letter of "index"?

    Well, why do you use 'j' as the variable for a nested loop? Because j is the next letter that automatically becomes an integer.

  119. You really don't have much room to speak by Anonymous Coward · · Score: 0
    Your first example is close. Your second example sucks.

    If 'array' is an array of ttl's that are set individually then it should be:
    ttl_array[4] = 5;
    That needs no comment.

    If 'array' is an object whose 5th element is the ttl for that object then you need to define a constant and use it:
    // object offsets
    #define TTL 4

    object[TTL] = 5;
    The actual setting needs no comment.

    Your first example at least suggests, and in no way implies, that array[4] might be a ttl. Most people would assume that it was. The comment would be better as 'set ttl'.

    Your second example is a misguided attempt to define the lvalue semantically by giving the rvalue a local constant name. It's better to give the lvalue a descriptive name in the first place and letting the '= 5' mean what it says!

    What are you going to do if you set array[4] multiple times in multiple locations and you need to see them all? The output you get from grepping for 'array[4] =' is going to be virtually meaningless!
  120. I just played games. by agent · · Score: 1

    Programming in 4 or 5 grade summer cool was fun. Palying Tapper was awsome, those 5 and then some inch floppy drives kicked but.

  121. Fight Frankfurters with Frankfurters by Anonymous Coward · · Score: 0

    yelling fire in a crowded theatre is a great idea, and should be encouraged.

    Only if there actually is a fire.

    But seriously, that's where America changed from the "Land of the Free, Home of the Brave" to the sniveling, destructive police-state it is today - with that particular Supreme Court opinion.

    When we really WERE both free and brave the people who were trampled in crowds were expected to defend themselves or accept their fate, and those who did the trampling were not permitted to blame their cowardice and cruelty on mere words.

    And if you are now going to whine and moan about how helpless and weak you are, or how defenseless your aged grandma is, well thank you for proving my point, you gutless franco-canadian!

  122. Good attitude by OhHellWithIt · · Score: 1

    I like his discussion of the limitation of human brains. I see people write clever code in Perl, and it's wonderful that they're so smart. But what's going to happen when they've flown the coop and I'm stuck here trying to maintain it? My mantra for these people is: If you don't plan on being chained to this project for the rest of your career, then please be sure ordinary mortals can understand your code!

    --
    "Who controls the past controls the future. Who controls the present controls the past." -- George Orwell
    1. Re:Good attitude by Mr.+Byaninch · · Score: 0
      I think that's universal. In every shop, there's people - really smart people - coding great stuff. (Well, OK, not every shop.) They code clever stuff, but no one else can see how it works.

      Comment your code. If you're one of those previously referenced smart people, you need to leave some hints about what you're doing. The rest can learn from it if they can understand it.

      And if you're at the other end of the scale, you need to leave some hints about what you thought you were doing.

      Bottom line: Code and comment the way you wish the author of what you're maintaining had coded and commented. You won't be giving away on which end of the scale you perceive yourself to be, but those who follow will like you better.

      --
      Sig not available, please try again later. If the problem persists, then the submitter is an idiot.
  123. I usually think FORTRAN-II by Medievalist · · Score: 1

    My first job with decent pay was writing FORTRAN-2 to test nuclear missiles.

    Did the job just fine. In fact, the code's still in use (as of six months ago, anyway), and was used to test several parts for the recent successful Mars missions.

    You can write unreadable crap in any language (probably easiest in Perl or Lisp). You can overrun data boundaries in FORTRAN ludicrously easily - but that's also true of C.

    Picking on FORTRAN is just grandstanding. Pick on a language with legions of frothing-at-the-mouth fanatic supporters (like Perl or Python for instance) if you've got the belly for a real fight.

  124. Worst Case Scenario by handy_vandal · · Score: 1

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

    Worst case scenario: aspirations to be management and end user.

    -kgj

    --
    -kgj
  125. Good, but said before... by po8 · · Score: 1

    I thought the article was a good summary of a lot of important code formatting concepts. If I have a critique, it's that I saw nothing that hasn't been said before, and at greater depth. See e.g. McConnell's Code Complete for a discussion of most of the issues raised in this piece.

    That said, anything that gets more exposure for these ideas increases the chances that I won't have to read so much FORTRAN-in-any-language. I view the article as a good thing.

  126. Good where it "kounts" by dbIII · · Score: 1
    You can write an ugly program in fortan just as easily as in perl - but you can write structured easy to understand programs in both.

    It's a case of the poor workman blaming the tools, complaining about people using gotos in weird places is just like people mismanaging memory in C - it's the people not the langauge. All it takes is to write out the code in a reasonable fashion, only branch to subroutines and to declare all of your variables instead of just introducing something like "kount" - beacuse people unfamiliar with fortran are not going to know that variables starting with k are assumed to be integers. It's all very simple stuff which was taught to engineering students very early in their courses. Keep it real. Doubly so if you need more significant places.

    Computers are used for a lot of things, not just typewiters and network services. Numerical computing still uses a lot of fortran.

  127. The next Nader book by Anonymous Coward · · Score: 0

    FORTRAN: Unsafe In Any Language

  128. Re:A great programming language, re: 1=2 by MmmDee · · Score: 1
    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

    This was really possible using HP's Fortran under RTE-IVB on an HP1000 computer circa early 1980's. The set-up was (with appropriate line indentations not shown).

    Program Test
    Call Change(1)
    write (*,"I4") 1
    end

    subroutine Change(j)
    j=2
    return
    Running this would print out: 2 (instead of 1)
    --
    No man's an island, unless he's had too much to drink and wets the bed.
  129. Optimization can be hidered by the language by Phatmanotoo · · Score: 1

    Optimization is a feature of the compiler, not the language.


    Yes, but the point is, some languages make so much easier for the compiler writers to come up with good optimizations. Read up on the "pointer aliasing" problem for instance. That's why numerical codes are (on average) always faster on f90/f95 than C/C++.
    1. Re:Optimization can be hidered by the language by fm6 · · Score: 1
      I think I'll simply take your word for it, since I don't have occasion to write a lot of scientific programming. (Well, any.) But I think the big issue is not how hard it is to optimize C. It's how good optimizing C compilers are in practice.

      My own opinion on this subject is worthless -- I don't have the CS background. But it seems to me that C compilers, as they're commonly used, don't produce code that's as optimized as it can be -- either because some of the more popular compilers don't optimize very well, or because too many programmers assume that only manual optimization will do.

  130. Valarray vs. Vector by colinrichardday · · Score: 1

    If one wanted to have an array optimized for number crunching, wouldn't one use valarray instead of vector?

  131. tsarkon reports ite irritating articles on the Web by Anonymous Coward · · Score: 0

    Then everyone does the following:

    - Use adblock + firefox/mozilla

    - Use proximitron or a NAT device that transparently blocks things in a way similar to adblock or proximitron

    - Use hosts files or a dns server that blacklist perpetual jerks like doubleclick.

    - Block all popups with IE or firefox/mozilla/opera

    - Use a proxy that is updated with a cron job with a list of jerks

    - etc.

    I miss the days of gopher and BBSes. Information was provided at a minor cost and the place you went to, e.g., the USRobotics BBS, had information and firmware about USRobotics products, and not cliksrv.net and other 3rd party marketing trash crap to decide who your customers could be or are.

    Telnet port 80 baby.

  132. In C you're always using pointers by Phatmanotoo · · Score: 1

    The thing is, in C you're always using pointers even if you think you're not: whenever you use arrays! The compiler is in general not allowed to assume non-aliasing, and therefore it cannot optimize fully in those situations. Google up some info about "pointer aliasing" in this context. That's why they had to come up with the new "restrict" keyword in C9X. Fortran never had these problems, that's why numerical codes run typically faster.

    1. Re:In C you're always using pointers by Rei · · Score: 1

      Fixed-dimension arrays don't use pointers to any greater or lesser degree than Fortran arrays do. And non-fixed-dimension arrays are dealt with via pointers, so it's obvious that you're using a pointer ;)

      --
      We also have a halon fire extinguisher. Its always nice to have a fire extinguisher that kills people around.
    2. Re:In C you're always using pointers by Anonymous Coward · · Score: 0

      Fixed-dimension arrays don't use pointers to any greater or lesser degree than Fortran arrays do. And non-fixed-dimension arrays are dealt with via pointers, so it's obvious that you're using a pointer ;)

      It seems like you're missing the point. In Fortran you are simply not allowed to call a subroutine using arguments that overlap in memory. [Fortran 77 standard, sec. 15.9.3.6] So the compiler can parallelize the array assignment example that was given while still conforming to the language standard.

      In the new 1999 C standard, you can give the compiler a similar guarantee using the semantic declaration restrict. And independently of that, some C or C-like compilers can take #pragma directives or nonstandard extensions for similar purpose.

      This improvement to C has put somewhat of a damper on the parallel-(C vs. Fortran) debate, but Fortran still has a small advantage in this area. In particular, it is much easier for a human to find aliasing in Fortran than in C, since you have to go out of your way (using EQUIVALENCE, POINTER, etc.) to accomplish it.

      And of course, neither language has compilers that can actually tell whether a given program is violating the semantic rules I have mentioned... this would be like expecting a compiler to find memory leaks. Though presumably tools like valgrind can be used to help find possible problems with aliasing.

    3. Re:In C you're always using pointers by coats · · Score: 1

      Complete and general aliasing analysis is NP-complete, IIRC. OTOH, it is somewhat easier in Fortran to stay within a linear-time "guaranteed not to alias" subset of programming constructions...

      --
      "My opinions are my own, and I've got *lots* of them!"
  133. C isn't fast enough for my equations. by ahdeoz · · Score: 1

    Bah! People like you were saying stuff that 3 years ago. And, while I admit Moore's law has stalled, my computer today runs that same algorithm in C than yours did in Fortran 3 years ago. And what's more, it runs as a distributed J2EE web-service with computation done entirely in xslt than your finely tuned. fortran equations ran in 1990.

  134. Cosmic! by fm6 · · Score: 1
    ...not FORTRAN any more...
    I don't think you can claim "Fortran" is more correct than "FORTRAN", or vice versa. The standards people still say "FORTRAN". Then again, it's a natural tendency to say "Fortran", since it's not an acronym. Then again, if IBM still cared about the trademark, you'd get a letter from their lawyers every time you did so. And if I were writing a style manual for a company that sold FORTRAN software, I'd make that the official usage. Not because it's "more correct", but because it'd be easier to enforce consistent usage. Then again (this is the last one), if my fellow employees balked at all those capitals, I'd change the convention without a qualm.

    I hear the notion that a particular usage is the usage so often, I should just bite my tongue and let the fallacy go by. But for now, I'll continue to say it: Language is not a cosmic principle handed down by God. Language is a convention arrived at by haphazard consensus.

    1. Re:Cosmic! by beliavsky · · Score: 1

      >I don't think you can claim "Fortran" is more >correct than "FORTRAN", or vice versa. The >standards people still say "FORTRAN". Then >again, it's a natural tendency to >say "Fortran", since it's not an acronym. Then >again, if IBM still cared about the trademark, >you'd get a letter from their lawyers every >time you did so.

      The official spelling has been "Fortran" since the 1990 standard. I don't think either "Fortran" or "FORTRAN" is an IBM trademark.

    2. Re:Cosmic! by hawk · · Score: 1

      >The standards people still say "FORTRAN".

      No they don't. There's a cutoff year, resulting in "FORTRAN 77" and "Fortran 90"

      >Then again, if IBM still cared about the
      >trademark, you'd get a letter from their lawyers
      >every time you did so.

      No, they couldn't. It was abandoned by them years and years ago. Copyrights and patents aren't lost by not protecting them, but trademarks are

      And as for all of the other bits and pieces, rather than putting in several other posts:

      1) There are several conflicting explanations as to whether or how to do this in C. They're all related to various useful functions; I'm not knocking them. However, Fortran just does it.

      2) I'll leave the details of compiler optimization t and what it does and doesn't do to those that understand it better.

      3) There certainly are various aproaches in the case where I used a goto. I even considered the ones that have been mentioned. Keeping the test in two places would have meant adjusting both while testing and solving the problem, while the function would have added overhead (it was at the bottom level of a loop at the core of the algorithm).

    3. Re:Cosmic! by fm6 · · Score: 1
      No they don't. There's a cutoff year, resulting in "FORTRAN 77" and "Fortran 90"
      OK then, I'd probably put "Fortran" in the style manual and justify by saying its the spelling used in the latest standard. But if my boss said, "No, keep it 'FORTRAN', it's too much trouble to revise all the manuals," I wouldn't accuse him of blasphemy against the language gods. And come to think of it, if the official name of one version of the language is "FORTRAN" and the official name of a later version is "Fortran", it's that much more silly to insist that one spelling is more "correct" than the other.

      As I said, language is a matter of convention. So far I've gotten two rebuttals, neither challenging my argument, but both telling me I'm using the "wrong language"! Picking nits is one thing (I do it myself), but isn't it a little silly to pick nits with somebody when their basic argument is that your particular nits are of no importance?

  135. Two conflated events by Anonymous Coward · · Score: 1, Informative

    http://rchrd.com/Misc-Texts/Famous_Fortran_Errors

    >From the alt.folklore.computers FAQ:

    III.1 - I heard that one of the NASA space probes went off course and
    had to be destroyed because of a typo in a FORTRAN DO loop.
    Is there any truth to this rumor?

    As revealed by past discussion in comp.risks (Risks Digest) as well as
    alt.folklore.computers and occasionally other newsgroups, this turns
    out to be a confusion of two separate events.

    The space probe that the DO-loop story has been wrongly attached to is
    Mariner I (or 1), which was intended for Venus (not Mars). Several
    incorrect or partially correct versions of what really happened were
    posted in comp.risks; the best of these cited a NASA publication called
    "Far Travelers" by Oran W. Nicks, but still did not have the whole story.

    Then in issue 8.75 we found out what really happened...

    | Date: Sat, 27 May 1989 15:34:33 PDT
    | From: Peter Neumann
    | Subject: Mariner I -- no holds BARred
    |
    | Paul Ceruzzi has written a truly outstanding book for the new show
    | that opened two weeks ago at the Smithsonian National Air and Space
    | Museum. The exhibit and the book are both entitled "Beyond the Limits
    | -- Flight Enters the Computer Age". Both are superb. Go for it (them).
    |
    | Paul has dug into several cases treated previously in RISKS and in
    | issues of the ACM Software Engineering Notes, and has been able to
    | resolve several mysteries. In particular he considers the case of
    | Mariner I, about which various inaccurate stories have been told.
    | Intended to be the first US spacecraft to visit another planet, it was
    | destroyed by a range officer on 22 July 1962 when it behaved
    | erratically four minutes after launch. The alleged missing `hyphen'
    | was really a missing `bar'. I quote from Paul's book, pp. 202-203:
    |
    | # During the launch the Atlas booster rocket was guided with the help
    | # of two radar systems. One, the Rate System, measured the velocity of
    | # the rocket as it ascended through the atmosphere. The other, the
    | # Track System, measured its distance and angle from a tracking
    | # antenna near the launch site. At the Cape a guidance computer
    | # processed these signals and sent control signals back to the
    | # tracking system, which in turn sent signals to the rocket. Its
    | # primary function was to ensure a proper separation from the Atlas
    | # booster and ignition of the Agena upper stage, which was to carry
    | # the Mariner Spacecraft to Venus.
    | #
    | # Timing for the two radar systems was separated by a difference of
    | # forty-three milliseconds. To compensate, the computer was instructed
    | # to add forty-three milliseconds to the data from the Rate System
    | # during the launch. This action, which set both systems to the same
    | # sampling time base, required smoothed, or averaged, track data,
    | # obtained by an earlier computation, not the raw velocity data
    | # relayed directly from the track radar. The symbol for this smoothed
    | # data was ... `R dot bar n' [R overstruck `.' and `_' and subscript n],
    | # where R stands for the radius, the dot for the first derivative
    | # (i.e., the velocity), the bar for smoothed data, and n for the
    | # increment.
    | #
    | # The bar was left out of the hand-written guidance equations. [A
    | # footnote cites interviews with John Norton and General Jack Albert.]
    | # Then during launch the on-board Rate System hardware failed. That in
    | # itself should not have jeopardized the mission, as the Track System
    | # radar was working and could have handled the ascent. But because of
    | # the missing bar in the guidance equations, the computer was
    | # processing the track data incorrectly. [Paul's EndNote amplifies:
    | # The Mariner I failure was thus a {\it combination} of

  136. processors by headkase · · Score: 1

    I did some googling and the Apple II used a 6502 processor while the Commodore 64 used a 6510.

    --
    Shh.
  137. Ratfor -- Rationalized FORTRAN by ufnoise · · Score: 1
    Ratfor is great. It is C without the semicolons and FORTRAN without the gotos. The best of both worlds. It is written by Kernighan of K&R fame.


    http://sepwww.stanford.edu/software/ratfor.html

    1. Re:Ratfor -- Rationalized FORTRAN by rnturn · · Score: 1

      Never had to/got to use it. A company I worked for back in the early '80s used to use a FORTRAN preprocessor called IFTRAN. It allowed you to write something like FORTRAN-77 with extra constructs; I recall that it allowed DO-WHILE, DO-UNTIL, and the like.

      The output was FORTRAN-IV that was run through the compiler. If you were into squeezing more performance out of the code, you kept the intermediate code and cleaned it up. See, the odd thing about this preprocessor is that it converted all of its coding structures into standard IF-GOTOs and a ton of numbered CONTINUE statements. Which wouldn't really be so bad but the PDP FORTRAN-IV compiler turned CONTINUEs into a NOOP instructions. For programs with highly nested loops and ifs structures, you could have a whole lot of long sequences of NOOPs throughout the resulting compiled code. After a while, I got to using some scripts to find and replace a long string of CONTINUEs with a single one and finding and replacing the line numbers throughout the code for the CONTINUEs that were being removed.

      Lest one think this was a waste, the effect on the execution of the program was appreciable. Back then, CPU time was getting charged back to the department. It was all funny money but the managers took it all so very seriously. Then we all got a PC on our desk and CPU time was, essentially, free from then on. And then the attitude was "Heh, we'll just let the program run all night".

      --
      CUR ALLOC 20195.....5804M
  138. Gotta love those misleading submitters by Anonymous Coward · · Score: 0
    Donn Seeley has assembled a rant that posits there are characteristics of good coding that transcend all programming languages, except Fortran.
    He pointedly DOES NOT say this. He says: "Many of the features that I look for in good code can be found in every general-purpose programming language, even Fortran."
  139. LOL! by Anonymous Coward · · Score: 0

    FORTRAN - The ugly but lovable little SOB (Score:5, Interesting)

    Some chicks say the same thing about my penis. LOL!

  140. Just for a laugh by Line_Fault · · Score: 1

    It's funny and it's kind of on topic!
    How to shoot yourself in the foot

  141. Re:I hate Fortran (an old fogey responds) :-) by Richard+Steiner · · Score: 1

    Heh. Real men use @FOR. :-)

    --
    Mainframe/UNIX Bit Twiddler and long time Windows/Linux Hobbyist.
    The Theorem Theorem: If If, Then Then.
  142. MOD DOWN by Anonymous Coward · · Score: 1, Informative

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

    Poster has absolutely no clue what s/he is talking about.

  143. Disallowing goto is not enough by krischik · · Score: 1

    It's an Ada example but still holds true in any language:

    http://en.wikibooks.org/wiki/Programming:Ada:Con tr ol#Isn.27t_goto_evil.3F

    Martin

  144. Re:Fortran 2003 - indeed by krischik · · Score: 1

    Yes, the "old time languages" have beein improved all the time and now almost all have OO and other interesting features. I think it is worth to have a look at them.

    (http://en.wikibooks.org/wiki/Programming_langua ge s_bookshelf)

  145. still taught in physics by Anonymous Coward · · Score: 0

    At the Australian National uni, argueably the strongest in the country for pure math and physics, well physics anyway, Fortran is still taught.

    Not at the Comp Sci dept, not at the math dept either. Where? In 3rd year physics. There is a computational physics course where you get an account on the super computer

  146. oops! by coats · · Score: 1
    ...that should have been
    ...during the early phases of gcc and g77 development
    [I'm a little too short on sleep after a proposal-writing binge;-(]
    --
    "My opinions are my own, and I've got *lots* of them!"
  147. Attention hoe, by Anonymous Coward · · Score: 0

    you are in no way at all similar in brainpower stature to a physicist. You look at planets and stars through telescopes. However, I will give you credit for being capable of wiping drool from your slobbering, quivvering, bottom lip and being able to shovel 70% or more of your food into your mouth at any given meal.

  148. Re:hardly unfortunate--Java, not C by Black+Acid · · Score: 1
    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.
    You're thinking of Java. Java doesn't have true multidimensional arrays. If you want them you need to calculate the index in a 1D array manually (necessary for faster graphics programs). An interesting side effect of "fictional" multidimensional arrays is they don't have to be rectangular. An array like this is perfectly valid in Java:
    int[][] a =
    {
    {1},
    {1,1},
    {1,2,1},
    {1,3,3,1},
    {1,4,6,4,1},
    {1,5,10,10,5,1},
    };
  149. restrict by tepples · · Score: 1

    Read up on the "pointer aliasing" problem for instance.

    Read up on the restrict qualifier of C99 for instance. It's a signal to the compiler that guarantees that two pointers so labeled in the same scope won't point to overlapping arrays.

  150. Fortran is STILL best for scientific apps. by changcho · · Score: 1

    Well, bash Fortran all you want, but for most scientific/engineering applications it's STILL the best, and will be the best for the foreseeable future. What can be done (and it's what we do here at work) is to write the math/scientific/engineering core of the application in Fortran, and put a C/C++/Visual Basic/Tcl-Tk GUI around it, if you wish. We've found this approach works really well.

  151. Re:Ah... But which notation is clearer? by Richard+Steiner · · Score: 1

    The CALL macro language I use here uses a nice mix, I think.

    Equivalence is either = or EQ (the latter is used with string variables to force a case insensitive comparison), assignment is :=, and block statements follow syntax like the this:

    LOOP WHILE xxxx DO
    blah
    blah
    ENDLOOP;

    (Could also be "LOOP UNTIL xxx DO", or "LOOP FOR xxxx := 1 to something DO", or just "LOOP DO", and the ENDLOOP can also have a WHEN clause attached).

    CASEENTRY xxxx OF
    CASE xxx:
    statements
    CASE yyy:
    statements
    CASE *:
    default if present
    ENDCASE;

    Most interesting is the way it does IF blocks:

    IF something THEN
    blah
    ELSE IF something else THEN
    blah blah
    ENDIF;ENDIF;

    --
    Mainframe/UNIX Bit Twiddler and long time Windows/Linux Hobbyist.
    The Theorem Theorem: If If, Then Then.