home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!psinntp!isc-newsserver!jsvrc
- From: jsvrc@rc.rit.edu (J A Stephen Viggiano)
- Subject: Re: Switching from Fortran to C
- Message-ID: <1992Sep10.150223.10784@ultb.isc.rit.edu>
- Sender: jsvrc@rc.rit.edu (Doctor FORTRAN)
- Nntp-Posting-Host: bruno.rc.rit.edu
- Organization: RIT Research Corp
- References: <1992Sep8.223138.4077@Comtech.com>
- Distribution: usa
- Date: Thu, 10 Sep 1992 15:02:23 GMT
- Lines: 34
-
- In article <1992Sep8.223138.4077@Comtech.com> syo@Comtech.com (Sinan Y. Othman) writes:
-
- >I am an experienced Fortran programmer who, after considerable resistance,
-
- (Apparently, not quite enough :-)
-
- >finally decided to switch to C. I would like to hear from others out there
- >who are, or have gone through, a similar process.
-
- The "little" things are the biggest pain. Like having to overcome the
- temptation, based on an old habit (a *good* one, though), of writing:
-
- printf (' The answer is %f7.4\n', answer);
-
- instead of:
-
- printf ("The answer is %7.4f\n", answer);
-
- and junk like that. You might get over it more quickly; I use both languages
- (FORTRAN for programming, C for hacking).
-
- Another thing to watch out for is (and I'm sure I'm not going to be the only one
- to tell you this) are the arguments to functions. Do you pass the argument
- itself, or a pointer to it? For numerical scalars, its quite simple. But for
- arrays, strings, etc., it becomes quite confusing -- an inherent and serious
- flaw in the language.
-
- But, of course, there are the advantages. With C, you can take advantage of
- hundreds of extensive numerical software libraries. In C your code will run
- more efficiently. (If you believe these statements, I own a bridge I'd like
- to sell you.)
-
- Why do I code in C at all, if it is so rotten? Because we have no FORTRAN
- compiler for several of our machines here. That's why.
-