Re: Ken & Klaus.
From: nessuno (nessuno_at_wigner.berkeley.edu)
Date: 09/17/04
- Next message: John Denker: "Re: forced vibration question"
- Previous message: Richard Herring: "Re: do sea water/lake water have definite frequency..."
- In reply to: Robert Newson: "Re: Ken & Klaus."
- Next in thread: Martin Blume: "Re: Ken & Klaus."
- Reply: Martin Blume: "Re: Ken & Klaus."
- Reply: beliavsky_at_aol.com: "Fortran vs. C (was Re: Ken & Klaus.)"
- Messages sorted by: [ date ] [ thread ]
Date: 17 Sep 2004 08:17:36 -0700
Robert Newson <ReapNewsB@bullet3.fsnet.oc.ku> wrote in message news:<414ABB87.7070100@bullet3.fsnet.oc.ku>...
> Jeff Relf wrote:
>
<snip>
I did a lot of Fortran programming, most of it Fortran 66 (!). The
older Fortrans were pretty awful by today's standards of what a
programming language should be. One problem in upgrading them was
that you had to introduce incompatibilities with previous versions to
change some things. For example, on going from Fortran 66 to Fortran
77, loop testing was moved to the start of the loop (in old Fortran,
all loops would execute at least once, unless you explicitly put in a
test to branch around them). I never learned Fortran 95, by then I
had switched to C. But it was obvious that in order to improve
Fortran 77, one would have to introduce further incompatibilities with
it. Once you've crossed this threshold, the question is, how far do
you go? If you're willing to go far enough in introducing
incompatibilities, you could transform Fortan exactly into C, maybe in
several steps if you wanted to do that. To me it seemed pointless.
Why not just use C?
Well, there's an answer to that, C, especially the original K&R C, was
not designed very well for numerical work. It was really a systems
programming language, not a numerical one. The attitude was, just get
it done, don't worry about efficiency. For example, the C rule that
all scalar floating arguments are by default double. Later C itself
was improved (also introducing some incompatibilities) and some of
these issues were met.
I used to make the same argument, that Fortran was better than C for
numerical work, especially simple programs where I just want to invert
a matrix and get the numbers out. That was because I had the rules
for Fortran in my head, and they're simpler than those of C, there's a
lot of machinery needed to get even a simple C program up and running.
But now I prefer C for everything. I've found things like pointers
and passing small structures by value to be very useful in C, and to
add enormously to the clarity of the organization of even moderately
sized programs, including scientific ones. Of course, you could
probably do most of this with Fortran 95, which I never learned. But
one reason I never learned it was that I already knew C by this time.
Nessuno
- Next message: John Denker: "Re: forced vibration question"
- Previous message: Richard Herring: "Re: do sea water/lake water have definite frequency..."
- In reply to: Robert Newson: "Re: Ken & Klaus."
- Next in thread: Martin Blume: "Re: Ken & Klaus."
- Reply: Martin Blume: "Re: Ken & Klaus."
- Reply: beliavsky_at_aol.com: "Fortran vs. C (was Re: Ken & Klaus.)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|