Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!bionet!ig!arizona!gudeman From: gudeman@arizona.edu (David Gudeman) Newsgroups: comp.lang.misc Subject: Non-professional programmers (was: Which language to teach first?) Message-ID: <13380@megaron.arizona.edu> Date: 22 Aug 89 00:21:21 GMT Organization: U of Arizona CS Dept, Tucson Lines: 51 In article <9015@june.cs.washington.edu> kolding@june.cs.washington.edu (Eric Koldinger) writes: >... >Why? Just because someone doesn't want to be a CS major doesn't mean that >he/she doesn't want to learn to program, or have need to program. What about, >for instance, engineering majors who often have to design large programs, but >aren't CS people, per se? You know a few years ago, I wouldn't have even noticed that last sentence. Since then I've had occasion to read a lot of code that wasn't written by Kernighan and Richie or other high-quality professionals, and have been appalled at how bad programming is out there. I have also had occasion to teach programming, and was surprised to find out how hard it seems to be for a lot of people. They just can't seem to grasp the concepts of modularity, reusability, maintainability, internal documentation, or simple elegance. I guess it's been so long since I went through that stuff, that I don't remember what a trial it was to learn. Perhaps more important is the idea of using efficient data structures and algorithms. I've seen functions consisting of nothing but a huge switch statement: switch (i) { case 0: return "0"; case 1: return "1"; case 2: return "2"; ... where the constraints on i clearly allowed the use of an array instead. I've had a discussion where I pointed out to someone how to turn a O(n^2) algorithm into a O(n) algorithm with the same constant factor, and he said it was a clever hack, but not worth implementing because "computers are getting faster all the time." He had been complaining about the speed of the O(n^2) algorithm, but he didn't seem to believe there would be much difference. I've seen a set of functions for handling linked lists, that all use the same global variable for list traversals. This has brought me to the conclusion that the era of non-professional programmers has past. The programming discipline has advanced to the point where it really does take four (or more) years of in-depth study to become competitive in the field. Would you expect an electrical engineer to design a car? A mechanical engineer to design a microchip? If not, then don't expect either one to design software either. -- David Gudeman Department of Computer Science The University of Arizona gudeman@arizona.edu Tucson, AZ 85721 {allegra,cmcl2,ihnp4,noao}!arizona!gudeman