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

  1. Path: sparky!uunet!noc.near.net!hri.com!spool.mu.edu!think.com!rpi!zaphod.mps.ohio-state.edu!darwin.sura.net!udel!louie!gloin.cis.udel.edu!carroll
  2. From: carroll@gloin.cis.udel.edu (Mark C. Carroll)
  3. Newsgroups: comp.lang.misc
  4. Subject: Re: Safety.  Was: Re: Pointers
  5. Message-ID: <1992Dec20.185158.17159@udel.edu>
  6. Date: 20 Dec 92 18:51:58 GMT
  7. References: <BzD7q3.KHr@mentor.cc.purdue.edu> <1992Dec18.164648.1857@udel.edu> <BzKCIn.Gr0@mentor.cc.purdue.edu>
  8. Sender: usenet@udel.edu (USENET News Service)
  9. Organization: University of Delaware, Newark
  10. Lines: 314
  11. Nntp-Posting-Host: gloin.cis.udel.edu
  12.  
  13. In article <BzKCIn.Gr0@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
  14. ]In article <1992Dec18.164648.1857@udel.edu> carroll@gloin.cis.udel.edu (Mark C. Carroll) writes:
  15. ]]In article <BzD7q3.KHr@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
  16. ]]]In article <1992Dec16.164456.6939@udel.edu> carroll@bifur.cis.udel.edu (Mark C. Carroll) writes:
  17. ]]]]In article <BzCxs6.9oC@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
  18. ]
  19. ]            .......................
  20. ]
  21. ]]]]The idea of bit-twiddling was obvious to the early people in
  22. ]]]]computing. But then, the problems of programming weren't very clearly
  23. ]]]]understood by them. The idea of a writing a program which required
  24. ]]]]hundreds of thousands of lines of machine code was almost beyond their
  25. ]]]]imagination, and the problems caused by trying to write, understand,
  26. ]]]]debug, and maintain such programs were completely unknown to them.
  27. ]
  28. ]]]It is true that they did not envision such large machine programs.  Maybe
  29. ]]]they were right about it; too often one is confronted with a "package"
  30. ]]]which has a few wanted things, lots of items about which one does not
  31. ]]]care, and a fair number of supposedly "user friendly" gadgets, which 
  32. ]]]are often quite "user inimical."  
  33. ]
  34. ]]Stick to the issue. We aren't talking about user interfaces here...
  35. ]]Programs have grown in size - we do things on our computers every day
  36. ]]that require incredible amounts of code to support - even if we
  37. ]]completely ignoring the quantity of code that supports user
  38. ]]interfaces.  Programs have grown, dramatically.
  39. ]
  40. ]Programs, designed essentially for non-numerical purposes, have grown in
  41. ]size.  But they have grown by attempting to provide too much, while at
  42. ]the same time not providing enough. 
  43.  
  44. You're doing nothing but revealing how completely out of touch you are
  45. with any area of computing outside of your own domain.
  46.  
  47. Programs have grown in side dramatically, and it's not just creaping
  48. featuritis. The problems that we're working on solutions to are
  49. dramatically larger than those we would have even attempted to work on
  50. a few years ago. Solving more complicated problems requires writing
  51. more complicated code.
  52.  
  53. ] This is even true with many of the
  54. ]numerical "packages", such as the statistics packages which can provide
  55. ]far too many of the usually inappropriate cookbook procedures, without
  56. ]providing for the use of procedures not in the cookbook which are the
  57. ]ones appropriate for the problems.  An example was the time I needed
  58. ]to compute exp(z)*erfc(x).  Now I KNEW that often this would be infinity
  59. ]times 0 if I used the functions as is, so I tweaked the source code to do
  60. ]this all at once.  This is an easy tweak, and someone who did not even know
  61. ]the source language would have no problem with it, even with an assembler
  62. ]source, provided a little programming knowledge was present. For example,
  63. ]I could tweak the Lisp code, or APL, and I am barely familiar with those
  64. ]languages.  But if only the package was available, the situation would
  65. ]have been hopeless, and I would have had to get an alternate source for
  66. ]the function, or reprogram it from scratch, using a less efficient 
  67. ]algorithm, and even facing roundoff problems.
  68.  
  69. This is yet another non-sequitur. If the packages that are available
  70. don't do the job, then don't use them. If the packages you want to use
  71. don't provide source code, then find one that does. If there isn't
  72. one, then write your own. (If the currently available packages are so
  73. bad, and they waste so much of your time, then surely it is worth your
  74. time to create one that will do the job!)
  75.  
  76. ]Now I am told that using multiple fonts in the same window can be done
  77. ]in X windows, but that it is a major undertaking. 
  78.  
  79. Non-sequitur, and not even true.
  80.  
  81. ]... We have elaborate
  82. ]typesetting devices, but on the machines accessible to me, we have no
  83. ]approximation of WYSIWYG, although this has been feasible at low cost
  84. ]for more than a decade. 
  85.  
  86. Again, not even true. WYSIWYG software is available on just about any
  87. machine you want. If you don't want to buy it, that's your business -
  88. but don't complain that it's the fault of the people teaching computer
  89. science.
  90.  
  91. And still - none of your points so far have *anything* to do with the
  92. issue that we are supposedly discussing: that being whether or not
  93. computer science is being taught correctly. 
  94.  
  95. ]]Just for example: I'm using a network protocol specification system
  96. ]]called Estelle. I've got an Estelle protocol analyzer based on a
  97. ]]system called Pet. The complete Pet system, including analysis and
  98. ]]simulation of protocols is well over a megabyte of object code. That's
  99. ]]a HUGE amount of code to deal with.
  100. ]
  101. ]]I have to extend Pet to do a particular kind of simulation. I've got
  102. ]]over 1 megabyte of code written by someone else to deal with. That
  103. ]]megabyte includes not one line of user-interface code, because I'm
  104. ]]using the stripped down command-line system. Now - what's going to be
  105. ]]more important to me? Knowing that my simulations will run 20% faster,
  106. ]]or knowing that I can build on top of pet without having to dig into
  107. ]]its internals to understand every facet of its implementation?
  108. ]
  109. ]I am familiar with the problems of simulations.  I hope you are not using
  110. ]any of the currently popular crude pseudo-random numbers to do it.
  111.  
  112. No, you are *not* familiar with the problems of simulations. You are
  113. familiar with the problems of simulations of statistical problems. My
  114. simulation is not statistical; I don't *need* perfect random number
  115. sequences; in fact, I don't need *any* random number sequences. My
  116. problem domain is *not* the same as yours; the problems that I
  117. encounter in my work are not the same as the problems that you
  118. encounter in yours, and your solutions to problems in your domain
  119. introduce significant new problems in mine.
  120.  
  121. Computer science shouldn't teach people to solve problems in one
  122. specific domain. I don't want to see computer science taught
  123. specifically from the viewpoint of network protocol programming,
  124. because people trained in that specific domain will be useless in all
  125. others.
  126.  
  127. If we taught CS your way, perhaps we'd create a crop of superb
  128. statistical programmers (I very strongly doubt it, because they'd
  129. focus too much on the low-level implementation and not enough on the
  130. algorithm design and optimization), but they'd be perfectly dreadful
  131. at working at anything else.
  132.  
  133. ]]]But the types of operations, etc., required do not change merely because
  134. ]]]one has lots of them.  Bits are twiddled because some useful operations
  135. ]]]require twiddling bits.  Virtually all branches are binary, with a few
  136. ]]]ternary such as sign.
  137. ]
  138. ]]Why does this seem to be a non-sequitur to me? What does bit-twiddling
  139. ]]have to do with the binary nature of most branches?
  140. ]
  141. ]People like me, who have no problem understanding them, use the binary 
  142. ]nature of branching, and otherwise.  Possibly the problems that many have
  143. ]had in the code which gave rise to the "hrubinstones" have been do to the
  144. ]lack of binary thinking, which is implicit in the algorithms I proposed.
  145.  
  146. And possibly, we had trouble because you fed us dreadfully written,
  147. convoluted, undocumented spaghetti code, written to solve problems in
  148. a domain with which none of us are familiar. (But you'll notice that
  149. still, after some time working out what you were trying to accomplish
  150. with that code, many people have suggested alternatives and
  151. improvements.)
  152.  
  153. Perhaps, just perhaps, the reason that no one understood what you
  154. were doing wasn't because you're so much smarter at computing than the
  155. rest of us. Perhaps it was because you didn't understand how to write
  156. code that clearly, effectively represented the algorithm that you
  157. were implementing.
  158.  
  159. ]]]]Good programming almost never requires bit-twiddling. It does require
  160. ]]]]clarity, modularity, documentation. A good programmer worries about
  161. ]]]]how difficult the code s/he writes will be to understand and maintain.
  162. ]]]]In general, the maintainability of the code is by far the most
  163. ]]]]important concern. Most of the time (virtually all of the time), the
  164. ]]]]speed of the code generated by the compiler is more than adequate, and
  165. ]]]]any gains to be made by adding bit-twiddling into the programming will
  166. ]]]]be more than outwieghed by the additional difficulty in understanding
  167. ]]]]and maintaining the code that takes advantage of them.
  168. ]
  169. ]The first step in good programming is to produce code which will work well
  170. ]for an adept, and which will do what a pundit will want to accomplish.  
  171.  
  172. No. The first step in good programming IS NOT PROGRAMMING. It is
  173. designing the correct algorithm. The second step is deciding how to
  174. represent that algorithm using the tools you have available. The last
  175. step is actually writing the code.
  176.  
  177. ]Only then should we put in the bells and whistles and blocks for someone
  178. ]stupid, who will do stupid things anyhow.  You seem to be concerned ONLY
  179. ]with providing tools for those doing low-level and routine operations.
  180. ]This is teaching them to do what the computers will eventually take over.
  181. ]This is the bane of the present day educational curriculum; the computer
  182. ]should do what computers can do well, and not try to keep humans from
  183. ]being innovative.
  184.  
  185. I claim that this paragraph states *exactly* what you are trying to
  186. do. You are concerned with nothing but the tools for doing low-level
  187. operations, a job for which the computer is far better qualified than
  188. you are. The people teaching computer science are teaching students to
  189. solve problems - and not to waste time on twiddling the lowest level
  190. of the implementation unless there is a significant gain to be had.
  191. Most of the time, there is no significant benefit in hand-tuning the
  192. code generated by the compiler; the stupid computer can do a very
  193. adequate job on the low level; the intelligent human should be doing
  194. the hard work.
  195.  
  196. ]]]Nothing you have stated here is new.  Unfortunately, much of what is done 
  197. ]]]now is the opposite of modular.  We have these massive operating systems 
  198. ]]]which do millions of things, and certainly the user can do nothing about 
  199. ]]]separating them most of the time.  So we impose restrictions like object 
  200. ]]]files have to have their names end in .o, C source files in .c, etc.  This 
  201. ]]]is NOT modular, it is the reverse of it.  We have moved from 5 or 6 bits/ 
  202. ]]]character to 8, and few systems allow the direct reading and writing of 
  203. ]]]these 8-bit characters.  
  204. ]]Another non-sequitur. You're confusing several different, completely 
  205. ]]independent issues.  
  206. ]]File naming conventions have nothing to do with language design. The 
  207. ]]fact the Unix prefers you to name your C code files *.c, and your C 
  208. ]]header files *.h doesn't have _any_ relationship to the modularity or 
  209. ]]lack of it in the C language.  
  210. ]Prefers is one thing, but having compilers which INSIST on it is another.  
  211. ]Now it must have been language, or compiler, designers who implemented 
  212. ]the systematic butchering of user names by adding underscores; the 
  213. ]facilities I used before encountering a UNIX-based system did no such 
  214. ]horror.  This is another example of trying to do too much; someone doing 
  215. ]anything different certainly does not want names changes by the system,
  216. ]expecially if different languages and compilers are being used.  
  217.  
  218. Programming languages are designed independent of operating systems.
  219. The linker that is provided by Unix is fundamentally braindead.
  220. There's no doubt of that, and I don't know of anyone who'll argue that
  221. point. But that's got nothing to do with the design of programming
  222. languages. The language is designed independent of any one
  223. implementation. It's true that we've got to deal with the brain-death
  224. of the Unix linker if we want to implement a language on Unix. But
  225. that still doesn't say anything about the quality (or lack thereof) of
  226. the languages that we design. (And, quite frankly, many of the newer
  227. languages have provided very elegant ways around the problems of
  228. cross-language linkage, even though they do use the Unix linker. Take
  229. a look at externals in C++, Eiffel, Sather, Modula-3, the glhc haskell
  230. compiler, T, and others) 
  231.  
  232.  
  233. ]And what if the modules cannot be interfaced without going through the 
  234. ]big nuisance of storing intermediate results in what are often massive 
  235. ]files?  
  236.  
  237. That's probably the result of poor program design. 
  238.  
  239. I've *never* used an intermediate file to pass results from one module
  240. of a program to another module of that same program. I've used
  241. intermediates for linking together two programs (when that's an
  242. appropriate way of doing so), but within a single program? 
  243.  
  244. ]... Try interfacing two statistical packages.  Try changing the 
  245. ]names in object libraries for which one does not have the assembler 
  246. ]source; the Fortran or C source is not even adequate.  Try making minor
  247. ]changes without going through a compiler which assumes it knows better 
  248. ]than you what you want to do.  
  249.  
  250. First, the implementation of two statistical packages has nothing to do
  251. with the issue we were discussing. Please stick to one subject at a time,
  252. please!
  253.  
  254. And second, if you have the Fortran or C source for the code, then you
  255. can generate the assembly code, so what are you babbling about? 
  256.  
  257. ]]]The speed generated by the compiler is only adequate if the facilities 
  258. ]]]are underused.  Now in many cases, this is not unusual.  It is not often 
  259. ]]]that the file management mechanism has to be quick in locating files.  
  260. ]]]And interactive editors do not have to be faster than the typist, EXCEPT
  261. ]]]that a shared computer can have many typists on at the same time. I have 
  262. ]]]often had to wait for editor response because of system load; doubling the 
  263. ]]]speed of the executing code would often help a lot.  
  264. ]]Not at all true.  
  265. ]]In many cases, the code generated by the compiler is faster than the 
  266. ]]code you'd write. The compiler can keep track of more information than 
  267. ]]you can, and it can use that information in ways that you probably 
  268. ]]wouldn't.  
  269. ]] .....
  270. ]The compiler can keep track of more information than I can, but it cannot
  271. ]use the information in a manner which its producer did not envisage. Nor 
  272. ]can it use information which it does not have.  
  273.  
  274. The ways of using information that the compiler designer didn't
  275. envisage are usually algorithmic changes that can be represented at
  276. the high level. In general, low-level optimizations are fairly simple
  277. - and the optimizations that you want are peephole, which means that
  278. they are well within the set of optimizations that a good compiler can
  279. and will perform.
  280.  
  281. ]That generally compilers can produce code which runs faster than that 
  282. ]produced by a programmer who only knows what has been taught in the 
  283. ]courses, or is explicit in the manuals, and who does not know how to 
  284. ]think in the symbolism and manner of someone with an undestanding of 
  285. ]the simplicity of abstract mathematics, should be a red flag in the 
  286. ]eyes of the curriculum designers. 
  287.  
  288. Perhaps if you studied a little bit about compilers and optimizations,
  289. you'd understand why this is a foolish statement.
  290.  
  291. Compilers routinely perform transformations that you could not do by
  292. hand, because you cannot keep track of a sufficient quantity of
  293. information. 
  294.  
  295. How often do you unroll your loops? How often do you do software
  296. pipelining? How good are you at keeping track of pipeline fills and
  297. interlocks?  How good are you at maximizing cache hits? Do you think
  298. that you'll be as good at all this as the compiler? It's the kind of
  299. work that the computer is very well suited to, but that people aren't.
  300.  
  301.  
  302. ]... Just as I cannot teach someone who  
  303. ]does not understand probability and statistical concepts, but instead
  304. ]"learns" statistics from the usual methods courses, how to do statistics 
  305. ]in a reasonable manner, teaching someone who learns how to program in 
  306. ]Basic or C to do good programming will not be possible.
  307.  
  308. I agree. But this paragraph again contradicts what you're claiming to
  309. want. We don't teach people to program in a particular language, or
  310. for a particular architecture. We teach people *how to program*.  Your
  311. claim is that that's wrong, and we should be much more
  312. hardware/language specific. Make up your mind...
  313.  
  314.     <MC>
  315. -- 
  316. || Mark Craig Carroll: <MC>     ||"We the people are getting tired of your lies
  317. || Univ of Delaware, Dept of CIS|| We the people now believe that it's time
  318. || Grad Student/Labstaff Hacker || We're demanding our rights to the answers
  319. || carroll@udel.edu             || We elect a precedent to state of mind"-Fish
  320.