Fortran vs. C for numerical work 
Author Message
 Fortran vs. C for numerical work


Quote:

>                                            ...When the time comes, I may
>even ask some of you what language you think is appropriate.  Until
>then, I don't want your silly-ass opinion.  If you want to compare
>languages, do it on comp.lang.misc where someone cares ...

This is bunk in my opinion, and I happen to be a "fairly typical"
fortran programmer.  Scientists cannot bury the head in the sand
in a rapidly changing field like computation, no matter how much
time it can take or how distracting it can be.  It is exactly this
kind of attitude that is the cause of so much of the garbage Fortran
that is written.  If these people were using C, it would probably be
garbage C.  Scientists need to be aware of these language issues and
be receptive to new ideas.  What are you doing to do when you find
yourself writing code for a 64,000 processor Connection Machine?  You
may find that the choice of programming language makes a big
difference.  And the day is not far off that parallel machines are
going to be where most scientific computation is going to be done.
This news group strikes me as quite appropiate for these language discussions
since it is read by exactly the audience most affected by these
developments in computers.

John Prentice
Amparo Corporation



Wed, 19 May 1993 06:07:56 GMT  
 Fortran vs. C for numerical work

Quote:

>     I think I'm pretty typical of Fortran users...
>                                                         ... Until
>then, I don't want your silly-ass opinion.  If you want to compare
>languages, do it on comp.lang.misc where someone cares ...

Bunk.  This kind of bull is one reason Fortran has a bad name, too
many scientists who stick their head in the sand and ignore developments
in computer science.  I too am a "typical Fortran user" and I for one
think that it is healthy to have debates such as this one.  It allows
people to see the virtues of other languages and maybe learn a little
about something new.  As to doing it in this news group, this one is
read by scientists and I therefore think it is perfectly appropiate
since it is exactly this audience that would best profit from knowing
more about computer science.  This is said, I would remind you, from
the perspective of a computational PHYSICIST, not a computer scientist.
I have to tell you, the world of scientific computing is changing and
one's choice of language (be it Fortran, C, or whatever you like)  may
very well have to change with it.  That is why I have found this discussion
helpful, it has illuminated several points on both sides that I had not
considered.  Perhaps there should be a new newsgroup for scientific
computation (or maybe one for ostriches), but I think this one is fine.

John Prentice
Amparo Corporation
Albuquerque, NM



Wed, 19 May 1993 10:22:33 GMT  
 Fortran vs. C for numerical work

Quote:
>     I think I'm pretty typical of Fortran users.  I know Fortran and a
>smattering of other languages.  I use Fortran mostly because

>     a) I can write code quickly in this language.
>     b) Compilers exist for it on any machine I'm ever likely to use.

>     I don't want to use C.  From what little I've been exposed to it, I
>don't like it.  C has a {*filter*} syntax which I don't have time to learn.
>Now everybody who's been trying to convince scientific programmers like
>me to learn C, go away!  Maybe you have the time to waste, but I don't.
>     Every algorithm I've ever used is expressible in Fortran.  (I've
>even written algorithms that create trees in Fortran using no
>extensions other than recursion... That's right, no pointers, just good
>old arrays.)  If ever I run across a problem that I can't code in
>Fortran, then I'll consider other languages.  When the time comes, I may
>even ask some of you what language you think is appropriate.  Until
>then, I don't want your silly-ass opinion.  If you want to compare
>languages, do it on comp.lang.misc where someone cares (notice the
>followup-to line).

Before this guy gets (justifiably) toasted in flames, it would be
worth considering that part of the reason he holds such
inflammable views is that there is a lot of language chauvinism
on all sides of the "my language is better than yours" war. This
is obviously part of our nature, as you could substitute "my
religion" or "my skin colour" for "my language", and explain most
of the world's problems.

What is really unfortunate is, that this guy has formed an
opinion about "C" without having the chance to be really
objective about it.

Quote:
>     Look, if someone out there can suggest a computer language that's
>easy to learn and code in and that has the sort of widespread base that
>Fortran does, I'll listen.  C just isn't for scientific programmers
>like me so it's no use trying to convince me (and probably 90% of the
>rest of the readership of this group) otherwise.  No one sensible would
>say that Fortran is the best language for everything, but it's a more
>than adequate language for most scientific computing.
>     While I'm at it, I sincerely hope that some cleaner language like
>Turing wipes C off the face of this planet.  I've about had it with all
>this "my language is better than yours" garbage from the C folk and can
>wish nothing for them other than extinction.

>                                Marc R. Roussel


If you don't like the "m.l.i.b.t.y" wars, why did you join in
with such fervour? Give yourself a break and take the chip off
your shoulder for a while.

-------------------+-------------------------------------------
Al Dunbar          |
Edmonton, Alberta  |  "this mind left intentionally blank"
CANADA             |          - Manuel Writer
-------------------+-------------------------------------------



Thu, 20 May 1993 01:25:17 GMT  
 Fortran vs. C for numerical work
The really sad thing about a lot of these kinds of debates is that many
people are frustrated at the long 'learning curve' for C. Many who
have programmed in other languages for years don't want to be forced
to 're-think' their programming style to suit a language. However, the
fact that one HAS programmed for years in a language is perhaps a good
reason to take a step back and consider some alternative methods. It's
too bad that it takes more time than many are willing to invest...

--
John L. Bradberry        |Georgia Tech Research Inst|uucp:..!prism!gt4512c


Marietta, Ga. 30067      |404 438-4181 (SCI)        |'...is this thing on..?'  



Sat, 22 May 1993 05:41:45 GMT  
 Fortran vs. C for numerical work
Would someone care to enlighten me as to why he or she thinks that C has
a difficult syntax and is difficult to learn? I just didn't have this
experience, and I came to C after having learned Fortran, Assembler
(MIX, on paper, and then the assembler for an obscure Japanese laboratory
mini) and BASIC. I understand the position of LISP fans with respect to
C syntax, since LISP syntax is clearly simpler (though I don't entirely
agree that this is a good thing, but that's another issue), but why
Fortran fans think that C syntax is more difficult is something that I
find mysterious. As far as I can tell, the difficulties that people
find in C stem from three sources:

        (a) C provides (via pointers and recursive functions) the
                ability to construct elaborate recursive data
                structures and the ability to traverse them.
                I suggest that the difficulties here are due to
                the fact that many programmers, especially Fortran
                programmers, are unfamiliar with data structures and
                recursion, but the problem is that these people need
                to learn these concepts, not a defect in the language.
                To make an analogy, most Algol-class languages lack
                closures, and people brought up on them may find
                it difficult at first to manipulate closures in a
                language like Scheme, but surely it is not
                a defect of Scheme that it provides them.

        (b) A few C constructs resemble constructs in other
                languages but are not the same. People brought
                up on these other languages don't like this.
                For example, gripes about the C switch statement
                seem basically to amount to the fact that it
                isn't the same as the Pascal case statement.

        (c) C doesn't provide run-time array bounds checking
                and some other safety features. I just don't
                see that this is that important. Surely it
                can be avoided by careful coding, and systems
                like Saber-C are available to do this at
                least at development time. But in any case,
                it isn't a syntax issue.

In short, there are a number of modern language features that
I like that C doesn't have, such as automatic storage allocation
and garbage collection, closures, first class functions, out of
band success/failure, and procedure suspension. These make me
sympathetic to arguments for using languages like ICON and Scheme,
at least for some purposes. But I really don't understand the
arguments coming from Fortran enthusiasts. So, would someone care
to explain why, from the point of view of Fortran, C can be
said to have a complex syntax and to be difficult to learn?

N.B.: I am aware of the efficiency arguments having to do with
aliasing. That's a different issue.

                                                Bill



Sat, 22 May 1993 09:14:41 GMT  
 Fortran vs. C for numerical work

Quote:

> Many who
>have programmed in other languages for years don't want to be forced
>to 're-think' their programming style to suit a language. However, the
>fact that one HAS programmed for years in a language is perhaps a good
>reason to take a step back and consider some alternative methods. It's
>too bad that it takes more time than many are willing to invest...

Hear, hear!  Exposure to different languages is
a tremendous benefit.  Learning Lisp and C++ gave
me a whole new outlook on programming; being able
to think in a different language, as it were, has
helped me to do things in C that I probably wouldn't
have been able to do otherwise.  (Learning Forth, on
the other hand, gave me some *really* {*filter*} programming
habits for a period of time, but I'm over that now :-)

--Joe English




Sat, 22 May 1993 12:19:16 GMT  
 Fortran vs. C for numerical work

Quote:

> Would someone care to enlighten me as to why he or she thinks that C has
> a difficult syntax and is difficult to learn? I just didn't have this
> experience, and I came to C after having learned Fortran, Assembler
> (MIX, on paper, and then the assembler for an obscure Japanese laboratory
> mini) and BASIC.

I agree. I started by reading about Fortran II and IV and mainframe
BASIC. Finally I had the actual experience of writing out some code
(mainframe BASIC again) and giving it to someone to see results a week
later. Then it was up through various assembler languages, MIX, Pascal,
a fortunately brief stint with tiddlywink microcomputer languages, and
now C. Somewhere along the line I picked up Forth, and had a lot more
trouble with it at first than I ever had with C.

It just isn't that hard a language to use, folks. Are you a Fortran
prorgammer who wants to learn C the easy way? Promise yourself to spend
five minutes a day putting your Fortran code through f2c and reading the
results until you understand them. Past that you're home free.

---Dan



Sat, 22 May 1993 12:30:13 GMT  
 Fortran vs. C for numerical work

Quote:
>But I really don't understand the
>arguments coming from Fortran enthusiasts. So, would someone care
>to explain why, from the point of view of Fortran, C can be
>said to have a complex syntax and to be difficult to learn?

I had the same experience as you - I learned BASIC, Fortran, Pascal, and three
different assembly languages before learning C, and found the latter the
simplest, syntactically.  I think that is mainly because I had assimilated a
basic understanding of semantics and learning one more syntax for well
understood semantics was not a big deal.

There are a few things a newcomer would consider "hard" about C, but of course
in most cases, if you only plan to do Fortran-like things, you would never
care.

Pointers: Fortran doesn't have them, so they could confuse someone who has
never seen one.  Coming from a Pascal background, though, I had been frustrated
at the lack of generality in its pointer scheme (you can't take the address of
a variable?  What about pointers to functions?) so C seemed a natural fix.
To a Fortran programmer, thugh, jumping from no pointers to practically
unrestricted pointers could be intimidating.  If you could avoid pointers, this
wouldn't be a problem, but you need them to implement pass by reference in C.
So this is the next hurdle for Fortran programmers: understanding the
distinction between value and reference.  Pascal programmers have it easier in
that it is more transparent, but at least going from Pascal to C, you have a
basic understanding of how the two modes work, so it is pretty natural to
translate syntax.  Until you want to pass a pointer by reference, and start
having to deal with pointers to pointers to...

Scoping: Fortran has only the most primitive scoping constructs.  With C, you
get to deal with the overloading of the word "static", with "extern"
declarations, and remembering when a declaration "char a[]" is interchangeable
with "char *a" (function arguments) and when it is not (extern declarations).

I/O: C's may be simpler to implement, but it can be intimidating to have 17
different functions, all of whose purpose is to read a few characters from a
file.

Loop constructs: why so many of them?  The "for" statement is more generalized
than your average numerical program will ever need.

Assignment/conditional/post/pre/increment/decrement operators: you can avoid
them if you want, but too often you see code that is rendered unreadable by
overuse of these.

Boolean operations: expressing them in numerical terms is an unnecessary (for
most Fortran programmers) generalization.  And why do you need parentheses
around the "if" argument?

Other things like having to declare variables before using them, etc - things
we all take for granted, can seem like arbitrary syntactic restrictions to a
Fortran programmer learning C.



Sun, 23 May 1993 00:45:09 GMT  
 Fortran vs. C for numerical work

Quote:
>(Learning Forth, on
>the other hand, gave me some *really* {*filter*} programming
>habits for a period of time, but I'm over that now :-)

On the contrary, it taught me the value of documenting even the most trivial of
operations, for fear of forgetting what I meant by "drop over dup dup".  It
also taught me how to be conservative with function arguments, to avoid
excessive copying of stack items.

Cobol; now *there's* a language I got nothing useful out of.



Sun, 23 May 1993 00:49:54 GMT  
 Fortran vs. C for numerical work
The Wheel of Life grinds on:


Quote:
>     I think I'm pretty typical of Fortran users.  I know Fortran and a
> smattering of other languages.  I use Fortran mostly because

I think I'm pretty typical of C programmers. I know quite a few languages,
including Fortran. I use C mostly because:

Quote:
>      a) I can write code quickly in this language.

     a) I can write code quickly in this language.

Fortran doesn't count here, beacause I spend too much time writing code
to simulate facilities available in every other programming language
since Basic and BCPL mutated out of effective existence. It's almost as
easy to code some stuff in assembly as it is in Fortran.

Quote:
> >     b) Compilers exist for it on any machine I'm ever likely to use.

     b) Compilers exist for it on any machine I'm ever likely to use.

So far as I know, Fortran and C are the only two languages I can make
statement b about.

I want to use Modula, or Oberon, or Tunis, or Euclid, or whatever. But
they're not {*filter*}y available. Or when they are there are enough differences
in the runtimes that code isn't even vaguely portable from one compiler
to another on the same machine... let alone another machine.

Quote:
>      Look, if someone out there can suggest a computer language that's
> easy to learn and code in and that has the sort of widespread base that
> Fortran does, I'll listen.

Look, if someone out there can suggest a computer language that's widely
available and doesn't require entering a straitjacket integrated environment
I'll use it.

Quote:
>      While I'm at it, I sincerely hope that some cleaner language like
> Turing wipes C off the face of this planet.

I'd love to see it, but I pray it takes Fortran with it.

You want to see this happen, start writing compilers.
--
Peter da Silva.   `-_-'
+1 713 274 5180.   'U`



Sun, 23 May 1993 01:04:50 GMT  
 
 [ 132 post ]  Go to page: [1] [2] [3] [4] [5] [6] [7] [8] [9]

 Relevant Pages 

1. Fortran vs. C for numerical work

2. Fortran vs. C for numerical work

3. C vs Fortran for numerical work

4. Fortran vs. C for numerical work

5. C vs Fortran for numerical work

6. Fortran vs. C for numerical work

7. Re : Fortran vs. C for numerical work

8. C++/FORTRAN for numerical work

9. Fortran vc. C for numerical work

10. Languages for Numerical Computation --- Was C vs FORTRAN

11. Different Numerical answers: VMS vs. Unix Fortran

12. Fortran vs C for numerical computation

 

 
Powered by phpBB® Forum Software