home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / edu / 1326 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  5.8 KB

  1. Xref: sparky comp.edu:1326 comp.lang.fortran:3149
  2. Newsgroups: comp.edu,comp.lang.fortran
  3. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!usc!sol.ctr.columbia.edu!destroyer!news.iastate.edu!IASTATE.EDU!btd
  4. From: btd@IASTATE.EDU (Benjamin T Dehner)
  5. Subject: Re: Small Language Wanted
  6. Message-ID: <1992Aug25.134143@IASTATE.EDU>
  7. Sender: news@news.iastate.edu (USENET News System)
  8. Reply-To: btd@IASTATE.EDU (Benjamin T Dehner)
  9. Organization: Iowa State University
  10. References: <DAVIS.92Aug23010605@pacific.mps.ohio-state.edu> <1992Aug25.034553.2990@linus.mitre.org> <1992Aug25.154501.8654@colorado.edu>
  11. Date: Tue, 25 Aug 1992 18:41:43 GMT
  12. Lines: 98
  13.  
  14. In article <1992Aug25.154501.8654@colorado.edu>, ejh@khonshu.colorado.edu
  15. (Edward J. Hartnett) writes:
  16. > In article <1992Aug25.034553.2990@linus.mitre.org> crawford@church.mitre.org
  17. (Randy Crawford) writes:
  18. > >In article <DAVIS.92Aug23010605@pacific.mps.ohio-state.edu>
  19. davis@pacific.mps.ohio-state.edu  (John E. Davis) writes:
  20. > >>Yes
  21. > >>Fortran is still superior to C for what it is intended to do: Numerical
  22. Work.
  23. > >>Anyone who ``regularly lambast physicists for using "old" languages like
  24. > >>Fortran'' is a little ignorant in my view.
  25. > >
  26. > >On a single statement basis, I'd agree: FORTRAN has it over C in expressing
  27. > >numeric computations (you forgot to mention the problems C has in evaluating
  28. > >expressions having mixed numeric types).  But if you've ever attempted to
  29. > >modify or even read a large FORTRAN program, you've experienced what I have 
  30. > >-- a rat's nest.  I don't believe it's possible to write modular FORTRAN
  31. > >code: at least, I've never seen it.  And unless FORTRAN 90 eliminates
  32. > >constructs like computed gotos, FORTRAN code will never become structured or
  33. modular.
  34. > I must disagree. While it is true that C is more often written more modular,
  35. it is
  36. > certainly possible to write well-behaved FORTRAN code. I think that
  37. > what you are seeing is not that FORTRAN lends itself to rotten code,
  38. > but that scientists usually write bad code, in whatever language they
  39. > use. No offense to scientists, but I have rarely if ever seen a
  40. > scientist who was a good programmer. They may know the language inside
  41. > out, they may be able to whip up their application in a day that would
  42. > take me a week, but take a look at it and you'll barf. Partly I think
  43.  
  44.     As a scientific programmer, I have no choice but to agree with the 
  45. above statement.  I am curently working on a program that was originally
  46. written in the late 1960's, and has since been heavily modified.  The original
  47. code had almost zero documentation, and almost none of the hordes of people
  48. who have gotten there hands in it since have explained what they did or what
  49. they are trying to do.  The only good thing about the code is that it is highly
  50. structured with many subroutines, so that I can look at one part at a time.
  51.  
  52. > that this is because they have other things to worry about (like the
  53. > purpose of the application, rather than implementation details),
  54. > partly because it's part of the myth of science that scientists are
  55. > smart, and so they think "I don't need to write simple, clear code,
  56. > I'm smart enough to figure it out if I have to," and a big part of it
  57. > is that they have either never studied programming, or they studied it
  58. > so long ago that it was before modern programming, and the benifits
  59. > thereof, were ever heard of. Essentially, they never know what they're
  60. > missing. They think code is supposed to be badly documented, poorly
  61. > structured, and difficult to understand.
  62.  
  63.     No, often the code is not really meant to be used by other people.
  64. Then when it does start getting spread around, ...
  65.    
  66. > I never use common blocks myself, ditto global variables (are their
  67. > global variables other than in common blocks?). Subroutine arguments
  68. > are always passed by reference, never value (how do you pass by
  69. > value?). User defined data types (i.e. structures) are available in
  70. > many implementations of FORTRAN (e.g. Sun), if you don't insist on
  71. > standard FORTRAN 77, ditto for loop constructs. I have to say right
  72. > here that I am talking about FORTRAN with extensions. I would never
  73. > like to write in strict standard FORTRAN. But I think that commercial
  74. > applications are rarely written in FORTRAN, and too many FORTRAN
  75. > programmers don't use the language extensions, althought there is
  76. > little chance they will ever have to port their code, and a good
  77. > chance that if they do, the other machine will support the same or
  78. > similar extensions.
  79.  
  80.     The code I have mentioned above has been beat into as standard of 
  81. Fortran as could be managed.  Anything nonstandard/system dependant is put
  82. into a special set of subroutines.   We can now routinely pass the code back
  83. and forth from an Ultrix system to a VMS system, and by adding the special
  84. subroutines -- about a 100 line file (out of about 12700 for the rest of the
  85. program) compile and run with no problem.
  86.   
  87. > >
  88. > >I think the real advantage that C has over FORTRAN (and Pascal has over C)
  89. is
  90. > >especially among undisciplined numerical programmers, where the "better" 
  91. > >language allows sufficient expressiveness to solve the problem, yet less 
  92. > >opportunity to write bad code.  And it's easier for "part-time" programmers 
  93. > >to write bad code in FORTRAN than in C.
  94.  
  95.     No.  C is such a terse language it is very easy to write bad code.
  96. It's your programming style and how much effort goes into making the code
  97. legible that counts, which, as mentioned above, scientists who mostly used
  98. Fortran tend not to do.
  99.  
  100. > Perhaps true, but learning C is a lot more difficult than learning
  101. > FORTRAN. Plus you're just not going to get around those thousands of
  102. > man-years of extant FORTRAN code!
  103.  
  104.  
  105. -----------------------------------------------------------------------------
  106. Benjamin T. Dehner    Dept. of Physics and Astronomy 
  107. btd@iastate.edu       Iowa State University 
  108.                       Ames, IA 50011
  109.  
  110.