home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / misc / 4048 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  7.3 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!ames!olivea!genie!udel!louie!bifur.cis.udel.edu!carroll
  2. From: carroll@bifur.cis.udel.edu (Mark C. Carroll)
  3. Newsgroups: comp.lang.misc
  4. Subject: Re: Safety.  Was: Re: Pointers
  5. Message-ID: <1992Dec16.164456.6939@udel.edu>
  6. Date: 16 Dec 92 16:44:56 GMT
  7. References: <Bz9FL2.9rp@mentor.cc.purdue.edu> <724478076@sheol.UUCP> <BzCxs6.9oC@mentor.cc.purdue.edu>
  8. Sender: usenet@udel.edu (USENET News Service)
  9. Organization: University of Delaware, Newark
  10. Lines: 127
  11. Nntp-Posting-Host: bifur.cis.udel.edu
  12.  
  13. In article <BzCxs6.9oC@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
  14. ]In article <724478076@sheol.UUCP> throopw@sheol.UUCP (Wayne Throop) writes:
  15. ]]Again, these points are so simple and so clear that it is
  16. ]]remarkable indeed to have anyone capable of reading and writing
  17. ]]disagree with them as Herman has.   And so I remark upon it.
  18. ]
  19. ]]] This is a chicken-and-egg phenomenon.  Most software development does
  20. ]]] not do certain things because the languages, compilers, and the training
  21. ]]] of the programmers does not mention them.  
  22. ]
  23. ]]That doesn't answer the question.  Herman specifically requested that
  24. ]]students be exposed to situations where code would "really crawl" unless
  25. ]]heroic and often architecture-specific measures are used to optimize it. 
  26. ]]Such cases are extremely rare, whether or not you believe in a catch-22
  27. ]]deadlock between hardware features and language features, or between
  28. ]]developer capabilities and language features. 
  29. ]
  30. ]If the actual code is not used, this may be difficult, but even the 
  31. ]initial idea that a computer manipulates objects, and that how it does
  32. ]this, and what objects it manipulates, are important.  But the idea of
  33. ]bit-twiddling, etc., seems to have been "obvious" to the early people
  34. ]in computing, and the use of binary in the mathematical literature
  35. ]before that time was extremely small.
  36.  
  37. The idea of bit-twiddling was obvious to the early people in
  38. computing. But then, the problems of programming weren't very clearly
  39. understood by them. The idea of a writing a program which required
  40. hundreds of thousands of lines of machine code was almost beyond their
  41. imagination, and the problems caused by trying to write, understand,
  42. debig, and maintain such programs were completely unknown to them.
  43.  
  44. Things have changed. We've learned a lot about programming since then,
  45. and we've discovered problems that they wouldn't have dreamed of. The
  46. solutions to their problems aren't necessarily the solutions to ours.
  47. What was natural to them, isn't necessarily natural to us. 
  48.  
  49. ]]] Unlearning
  50. ]]] provides major obstacles for students in mathematics and statistics, and
  51. ]]] I see no good reason why CS and programming languages should be any
  52. ]]] different in this matter.
  53. ]
  54. ]]Precisely my point.  CS students under Herman's regime would have
  55. ]]much to unlearn before they could read, write, or even think about
  56. ]]portable, maintainable software.  These issues may not be important
  57. ]]to Herman, but Herman is the exception.
  58. ]
  59. ]They would have to unlearn nothing.  Starting out with the idea that
  60. ]there is a large variety of objects, and that machines operate on them
  61. ]in various ways, WILL cause them to question why the languages place
  62. ]obstacles in their use.
  63.  
  64. They would have to unlearn a *lot*.
  65.  
  66. Good programming almost never requires bit-twiddling. It does require
  67. clarity, modularity, documentation. A good programmer worries about
  68. how difficult the code s/he writes will be to understand and maintain.
  69. In general, the maintainability of the code is by far the most
  70. important concern. Most of the time (virtually all of the time), the
  71. speed of the code generated by the compiler is more than adequate, and
  72. any gains to be made by adding bit-twiddling into the programming will
  73. be more than outwieghed by the additional difficulty in understanding
  74. and maintaining the code that takes advantage of them.
  75.  
  76. Most programming doesn't care about the internal representations of
  77. its information. In most cases, *it doesn't matter*. For example, I'm
  78. writing a program that does a graphical simulation of a network
  79. protocol. I'm not worried about speed, because I've already got to
  80. slow down the execution of my system to let a human being follow it.
  81. What I am worried about is *correctness* and *maintainability*. 6
  82. weeks from now, I'll be done with this project, and some other poor
  83. schmoe is going to have to take it over, and continue work on it. When
  84. that guy gets hold of it, it's absolutely crucial that
  85.     (a) my code be understandable, so that he can expand on it
  86.     (b) my code be correct, so that when he tries to expand it, he isn't
  87.       forced to waste time discovering my bugs;
  88. and (c) my code be *clean*, so that when he extends it, my code doesn't
  89.       break his, and his code doesn't break mine.
  90.      
  91.  
  92. ]]] The student who takes a typical cookbook mathematics course seems to
  93. ]]] be farther away from eventually understanding than the one who starts
  94. ]]] out with the concepts and theory.
  95. ]
  96. ]]But the concepts of and theory of mathematics do not have much to do
  97. ]]with the bit-bumming he recommends early exposure to, so Herman's point
  98. ]]is obscure in the extreme.
  99. ]
  100. ]The bit operations are just the binary version of the "standard" decimal
  101. ]operations, and are by no means esoteric, except in the minds of those
  102. ]who would have people grow up ignorant of them.  The goto-laden code I
  103. ]posted was obtained from consideration of how to efficiently use "coin
  104. ]tosses", or other sources of random bits, to produce exponential random
  105. ]variables, and this topic is by no means of recent origin.  Base 2 is
  106. ]useful because it is useful, and not because of arcane considerations.
  107.  
  108. The bit operations *are* esoteric, because the bit representations are
  109. generally esoteric. In most programs, the programmer writes code to
  110. deal with *integers*, not 16bit 2s complement quantities. It's true
  111. that the concept the programmer wants to deal with may get represented
  112. in the machine by 16bit 2s complement quantities, but for the purposes
  113. of the program being written, it doesn't matter. To go back to the
  114. example of my current project, if I shifted to a machine which used
  115. 64bit 1s complement numbers instead of 32bit 2s complement, it
  116. wouldn't affect my code a whit.
  117.  
  118. It's true that in *your* problem domain, these things matter. But your
  119. domain is one, small, narrow niche. The overwhelming majority of us
  120. who program don't share your concerns - we have our own worries, which
  121. don't matter to you. But that doesn't mean that we're imcompetent or
  122. negligent - the problems we're solving are the problems that need to
  123. be solved for the work done by the largest number of people.
  124.  
  125. As I've said before, you're *terribly* ignorant about computer
  126. science. You don't understand what problems we're trying to solve, and
  127. you don't care. That's all right - you have your own work to do. But
  128. so do we. We don't tell you what's wrong with the way you do
  129. statistics - we're far too ignorant of statistics to be able to
  130. intelligently comment on your methods. But equally - you're *far* to
  131. ignorant of computer science, programming languages, and compilers to
  132. be able to intelligently comment on ours.
  133.  
  134.     <MC>
  135. -- 
  136. || Mark Craig Carroll: <MC>     ||"I prize the cloudy, tearing sky,
  137. || Univ of Delaware, Dept of CIS|| for the thoughts that flap and fly.
  138. || Grad Student/Labstaff Hacker || For staying in and reading by.
  139. || carroll@udel.edu             || For sitting under" -Karen Peris
  140.