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

  1. Xref: sparky comp.arch:9146 sci.math:10828 comp.lang.misc:2875 comp.lang.fortran:3359 comp.edu:1469
  2. Path: sparky!uunet!utcsri!relay.cs.toronto.edu!neuron.ai.toronto.edu!ai.toronto.edu!radford
  3. Newsgroups: comp.arch,sci.math,comp.lang.misc,comp.lang.fortran,comp.edu
  4. From: radford@cs.toronto.edu (Radford Neal)
  5. Subject: Re: Scientists as Programmers (was Re: Small Language Wanted)
  6. Message-ID: <92Sep1.205116edt.669@neuron.ai.toronto.edu>
  7. Organization: Department of Computer Science, University of Toronto
  8. References: <1992Aug31.170849.11927@mprgate.mpr.ca> <1992Aug31.195540.13074@ctr.columbia.edu> <1992Sep1.115849.13522@relay.nswc.navy.mil> <Btx4vF.Jx6@mentor.cc.purdue.edu>
  9. Date: 2 Sep 92 00:51:38 GMT
  10. Lines: 157
  11.  
  12. In article <Btx4vF.Jx6@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
  13.  
  14. The following post is so profoundly incorrect that I feel compelled to
  15. respond (despite the fact this is usually a Bad Idea on usenet :-).
  16.  
  17. Perhaps I should note that I have 18 years experience in programming,
  18. have programmed in numerous assembler languages, and most high-level
  19. languages you could think of (yes, including Fortran and Cobol :-),
  20. and have lots of experience in both systems and application
  21. programming, including statistical applications (in fact, the later is
  22. the topic of the Ph.D. thesis I am currently working on). I'm not one
  23. of those CS graduates who aren't sure what an assembler is, who have
  24. been mentioned earlier in this thread...
  25.  
  26.  
  27. >Software engineering is not that relevant in general.  What is relevant is
  28. >the translating of the problem to be computed into the collection of bits
  29. >which the machine can understand to accomplish the task.  
  30.  
  31. Someone has greatly mislead you concerning what constitues software 
  32. engineering. Your second sentence is a good first cut at a definition!
  33.  
  34. >This involves
  35. >
  36. >    Knowing the algorithmic processes which can be applied, their
  37. >    strengths and weaknesses, and what happens to them on the particular
  38. >    machine when they are translated using the available languages.
  39. >
  40. >    Evaluating the costs of using the tools.
  41.  
  42. This is a good second cut at defining "software engineering"! 
  43.  
  44.  
  45. >If a procedure can use some of the machine instructions and the languages
  46. >available to the programmer cause code to run considerably slower because
  47. >the languages cannot use those instructions, the languages are inadequate. 
  48. >No amount of software engineering, or compiler optimization, and get around
  49. >this.  It is this feature which can make major differences in the relative
  50. >speeds of computing on different machines.
  51.  
  52. This is seldom true. In fact, machines and programing languages have
  53. co-evolved in such a way as to practically ensure this. (From a later
  54. comment, perhaps you realize this...) The result may not be a global
  55. optimum, but it appears that the effort required to do something
  56. radical is not worthwhile at the moment, and will not be until the
  57. rate of progress being achieved with present architectures slows down.
  58. (Look at the state of "Lisp machines" to confirm this - and they
  59. aren't even very radical, really!)
  60.  
  61. There are exceptions, of course. The CDC 6000 series had (has? It's
  62. been years...) a special "count bits" instruction, for example. No
  63. language has this as a built in operator. You can get at it via a call
  64. to an assembly-language subroutine, however. The subroutine call
  65. overhead will almost always be insignificant.
  66.  
  67. More generally, there are languages that lack certain capabilities
  68. that are available in any assembly language. Pascal does not allow a
  69. variable to contain a pointer to a procedure, for example. While some
  70. of the time this will just be an oversight, more typically, it results
  71. from a particular vision of programming, which the language is trying
  72. to support. Such visions are essential to progress, much more so than
  73. a miscellaneous collection of "features".
  74.  
  75. For example, the idea of variables (or structure fields) containing
  76. pointers to procedures is seen to be much more useful when you know
  77. how to use them to support object-oriented programming. This
  78. conception did not originate via C, which has always had the feature,
  79. but rather via Simula, which has never had explicit procedure
  80. variables...
  81.  
  82.  
  83. >The CS curricula exascerbate the problem by indoctrinating the student in
  84. >the attitude that the machine instruction set is not to be considered in
  85. >normal programming. 
  86.  
  87. While "indoctrination" is, of course, undesirable, the indicated
  88. attitude is indeed correct. Try writing a commercial program in
  89. assembly language and see how popular you are with the boss when he
  90. finds out that because of this the company can't switch to a new
  91. machine that's cheaper and faster. Or that the program stops working
  92. when a new release of the standard subroutine library is installed,
  93. with a different calling convention. Or that there's a much faster
  94. algorithm that a sensible programmer would have found, in the time you
  95. wasted grubbing for microseconds at the machine level.
  96.  
  97. He'll probably be even less impressed if you did this for a one-shot
  98. program for which none of the above are relevant.
  99.  
  100. There are some exceptions, of course. At one time, at least, the IBM
  101. PC was so popular that one could economically justify spending
  102. enormous effort making certain programs as small and fast as possible
  103. by programming them in assembly language. At least, it became
  104. economically justifiable to do this once enough other people did it
  105. that, for better or worse, the machine had become inextricably tied
  106. not just to a particular processor, but to a particular layout of
  107. memory, devices, etc. (Using assembly language would now probably be a
  108. mistake, except for coding of a few time-critical routines, since the
  109. complexity of the applications is now much greater.)
  110.  
  111. Other cases would be software that has time-critical interactions with
  112. the real world, or software that runs on a machine with an unusual
  113. architecture (some parallel machines, perhaps), etc. This is why
  114. indoctrination is bad - you need to known when an exception comes up.
  115.  
  116.  
  117. >There can, and should, be interaction at compile time between the compiler
  118. >and the programmer.  The compiler also should be able to suggest rearranging
  119. >machine instructions, not just the output from HLLs.  
  120.  
  121. This would occasionally be useful. I sometimes look at the output of
  122. the compiler to see if it is generating reasonable code, and to find
  123. out if there's any point in my doing certain optimizations at the
  124. source level (e.g. loop unrolling). This is reasonable for me to do
  125. because I have years of experience at this sort of thing. It probably
  126. isn't reasonable for you to do it.
  127.  
  128. In any case, the sort of full-blown tool you describe just isn't on.
  129. The effort involved would earn much higher returns if devoted to
  130. producing a better debugger, a better optimizer, a better chip layout,
  131. etc. The rapid speed increases we see don't just happen - they result
  132. from huge investments in research and development. While you may not
  133. realize it, you are essentially saying to the manufacturers, "Stop
  134. working on that new processor that's twice as fast as my current one,
  135. I'd rather you put your effort into letting me play with machine
  136. code!"
  137.  
  138. Also, have you considered the number of bugs that such a facility
  139. would contain? Despite what the manufacturers may want you to believe,
  140. the current state of compiler reliability is not good. I find that
  141. when I undertake a major project (a program of, say, 10000 lines), I
  142. generally end up discovering two or three bugs in the compiler. I
  143. usually find these bugs fairly rapidly (in fact, I find some of my own
  144. bugs by unsuccessfully trying to demonstrate that they lie in the
  145. compiler :-). I shudder to think how much time casual programmers may
  146. waste when their perfectly good program malfunctions. Perhaps they end
  147. up abandoning it. Can you really say that fixing these compiler bugs
  148. is lower priority than producing a tool that maybe 5% of programmers
  149. will use on maybe 5% of their programs, in order to gain a 5% speed
  150. increase?
  151.  
  152.  
  153. >What we are teaching the CS students, and even the software engineers, is 
  154. >essentially the mistake made in teaching methods without understanding in
  155. >mathematics and statistics.  Someone who has only learned a particular
  156. >collection of methods is extremely unlikely to consider anything not in
  157. >that particular bag of tricks.  Training is not education.
  158.  
  159. Yes. A CS graduate who intends to work as a software engineer should
  160. BE ABLE to work at all levels, even more so for a computer scientist
  161. designing a new programming language or operating system. They should
  162. also know enough not to work at the machine level unless there is a
  163. good reason, which isn't very often for application programming. Most
  164. non-professional programmers would be well advised to think about
  165. their problem more, rather than learn the assembly language of the
  166. machine they are using this month.
  167.  
  168.     Radford Neal
  169.