home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / fortran / 3235 < prev    next >
Encoding:
Text File  |  1992-08-27  |  3.2 KB  |  69 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!lanl!cochiti.lanl.gov!jlg
  3. From: jlg@cochiti.lanl.gov (Jim Giles)
  4. Subject: Re: scientists as programmers
  5. Message-ID: <1992Aug27.180414.25183@newshost.lanl.gov>
  6. Sender: news@newshost.lanl.gov
  7. Organization: Los Alamos National Laboratory
  8. References:  <1992Aug27.140153.23191@colorado.edu>
  9. Date: Thu, 27 Aug 1992 18:04:14 GMT
  10. Lines: 57
  11.  
  12. In article <1992Aug27.140153.23191@colorado.edu>, ejh@khonshu.colorado.edu (Edward J. Hartnett) writes:
  13. |> [...]
  14. |> I think I should have been more clear when I said that scientists are,
  15. |> in general, not as good programmers as professionals. [...]
  16.  
  17. People who write scientific/numerical programs for a living (instead
  18. of as an adjunct to their scientific work) *ARE* professionals.  Yet,
  19. their background is real science, not computing "science" (because no CS
  20. type would even understand the problems).
  21.  
  22. |> [...]
  23. |> If I could sit down all those scientists in a room and tell them one
  24. |> thing, it would be that in all my experience programming, nothing is
  25. |> more worthwhile than documentation. Particularly with science, if it's
  26. |> not documented, it's almost useless, and will be completely useless
  27. |> whenever it's handed to someone other than the original programmer.
  28. |> Why? Because with science you have to KNOW what's going on in the
  29. |> code. A small mistake can EASILY skew scientific results. And the time
  30. |> invested in organization and documentation is more than repaid again
  31. |> and again. 
  32.  
  33. However, too many CS types view documentation as an end rather than
  34. a means - that is, they write comments which do not elucidate:
  35.  
  36.       x++;  /* add one to x */
  37.  
  38. A good document consists of an abstract description of what the code
  39. does, an abstract description of the algorithm which is being used, its
  40. numerical properties, its speed (using big O notation if more precision 
  41. is not available).  The code itself has only a *few* imbedded comments 
  42. which indicate the correspondence of the code to the abstract algorithm.  
  43. One should not try to explain the algorithm *with* interspersed comments, 
  44. nor should one merely restate in english what the specific statements do 
  45. (if you can't read the language, take a tutorial).
  46.  
  47. Too often, the CS style documentation contains headers which name
  48. the programmer, give the date of completion of the code, the date
  49. of the last modification or bugfix, the language used (as if you
  50. couldn't tell by looking at the code itself), and some joke about
  51. known bugs that the author will *soon* fix (though the last mod
  52. was years ago and the author has since left).  The author then
  53. tries to explain the algorithm with interspersed comments *in* the
  54. body of the code - and fails to write *either* a good description
  55. of the algorithm *or* a good code.  But it's "fully documented"
  56. by the criteria they were tought in school.
  57.  
  58. |> [...]
  59. |> I guess it's exactly the same with professional programmers; I wasn't
  60. |> convinced of this until I ended up with a job working on someone
  61. |> else's code, [...]
  62.  
  63. Gee, in *all* my jobs, for 20 years, I've had to work with someone
  64. else's code.  The dreaded "someone else's code" problem is commonplace
  65. in programming.
  66.  
  67. -- 
  68. J. Giles
  69.