home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / fortran / 3517 < prev    next >
Encoding:
Text File  |  1992-09-11  |  1.8 KB  |  48 lines

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