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

  1. Xref: sparky comp.edu:1361 comp.lang.fortran:3199
  2. Newsgroups: comp.edu,comp.lang.fortran
  3. Path: sparky!uunet!stanford.edu!leland.Stanford.EDU!gooch
  4. From: gooch@leland.Stanford.EDU (Carl Gooch)
  5. Subject: Re: Small Language Wanted
  6. Message-ID: <1992Aug26.195551.11962@leland.Stanford.EDU>
  7. Sender: news@leland.Stanford.EDU (Mr News)
  8. Organization: DSG, Stanford University, CA 94305, USA
  9. References: <DAVIS.92Aug23010605@pacific.mps.ohio-state.edu> <1992Aug25.034553.2990@linus.mitre.org> <1992Aug25.154501.8654@colorado.edu>
  10. Date: Wed, 26 Aug 92 19:55:51 GMT
  11. Lines: 56
  12.  
  13. In article <1992Aug25.154501.8654@colorado.edu> ejh@khonshu.colorado.edu (Edward J. Hartnett) writes:
  14.  
  15. >I don't mean to sound like I'm running down scientists at all. I'm
  16. >just saying that the problems lie not in our stars, but in ourselves.
  17. >You can have good programs in any programming language, and bad
  18. >programs ditto. It's more a function of the programmer's outlook and
  19. >training than the programming language (IMHO). 
  20.  
  21. I'd agree with that.  If you're writing a piece of code that you know
  22. will be 5000+ lines and that you're going to have to maintain and
  23. improve for a long time to come, you write it reasonably well in
  24. self-defense.  I'll grant that the definition of "reasonably well"
  25. varies between individuals, but I doubt there are many large new
  26. Fortran codes being written with flocks of arithmetic if's and
  27. computed goto's.  
  28.  
  29. >I never use common blocks myself, ditto global variables (are their
  30. >global variables other than in common blocks?). Subroutine arguments
  31. >are always passed by reference, never value (how do you pass by
  32. >value?). User defined data types (i.e. structures) are available in
  33. >many implementations of FORTRAN (e.g. Sun), if you don't insist on
  34. >standard FORTRAN 77, ditto for loop constructs. I have to say right
  35. >here that I am talking about FORTRAN with extensions. I would never
  36. >like to write in strict standard FORTRAN. But I think that commercial
  37. >applications are rarely written in FORTRAN, and too many FORTRAN
  38. >programmers don't use the language extensions, althought there is
  39. >little chance they will ever have to port their code, and a good
  40. >chance that if they do, the other machine will support the same or
  41. >similar extensions.
  42.  
  43. It's true that common blocks don't help code readibility, but there
  44. are cases where not using them requires passing a long list of
  45. parameters several steps up and down a call tree.  In those cases, I
  46. prefer to use common and pass only parameters which are immediately
  47. relevant.  (I also declare common blocks and the variables contained
  48. in them in include files, so that I never have to worry about my
  49. declarations of the same common block conflicting.)
  50.  
  51. Extensions like do-while loops are common enough that I use them
  52. freely, partly because in an emergency, the changeover to if ... goto
  53. ... wouldn't be very painful.  Structures I tend to avoid, in part
  54. because that's a less common extension and in part because the changes
  55. to unsnarl it would, generally, be rather large.  If I were writing
  56. for a single platform, I'd be a lot less picky about extensions.
  57.  
  58. Your mileage, of course, may vary.
  59.  
  60. Carl
  61.  
  62.  
  63.  
  64. -- 
  65. ------------------------------------------------------------------------------
  66. Carl Gooch                       |        Why am I inside at a keyboard when 
  67. gooch@leland.stanford.edu        |        I could be outside riding bike?
  68. ------------------------------------------------------------------------------
  69.