Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!sirius.ucs.adelaide.edu.au!augean!sibyl!ian From: ian@sibyl.eleceng.ua.OZ (Ian Dall) Newsgroups: comp.arch Subject: Re: religion and computer science Message-ID: <783@sibyl.eleceng.ua.OZ> Date: 24 Jul 90 06:28:20 GMT References: <20955@duke.cs.duke.edu> Reply-To: ian@sibyl.OZ (Ian Dall) Organization: Engineering, Uni of Adelaide, Australia Lines: 69 In article <20955@duke.cs.duke.edu> drh@cs.duke.edu writes: >I approached my course with what might be termed a "progressive" viewpoint. >.... >This stretegy failed, and by the end of the course I had converted to a >programming demogogue, mandating a very specific indentation and commenting >style and prohibiting global variables and subprograms longer than 30 lines. >If I had it all to do over, I would be even more rigid. When you learn most skills you do exercises. Often coaches in physical activities will get their charges to exagerate a certain motion in training to improve their style. In a more closely related area, I remember when I first learned algebra we had to write in margin the axiom which allowed us to do each step. Somewhere along the line a tennis player learns that, in a match, it is better to make the shot with his feet in the wrong position than not make the shot at all. And somewhere along the way I learned that the axioms in the proof could normally go unstated. I have no objection to programming *exercises* which have a strict discipline, but they need some "match practice" as well before they are released on the real world. Don't get me wrong, I am all in favour of modular code etc but I have certainly run across some people with little real experience making dogmatic statements about *never* using goto's etc. To that extent, I agree with the thesis that some CS people haven't acquired the right set of priorities. >3. Random walk indentation: I initially allowed students to use any > "consistant" indentation style. Some students reasoned that no > indentation is consistant, and so every line of their programs began > at the left margin. (This was the popular pick from the BASIC crowd.) > The rest of the class must have assumed that a white noise process is > "consistant" since for these students the left margin looked like the > walk of a drunken sailor and was largely unrelated to the program's > structure. Both styles resulted in the same set of problems: > a. Students were unable to follow their own programming logic. > b. Students spent hours looking for silly errors such as a BEGIN > without a matching END. > c. The instructor nearly went blind trying to read the student's > code. > Only after implementing rigid and uniform indentation rules was I > able to bring some order to the students' programs. I think correctly indented programs are great. The trouble is I think it is of only marginal benefit getting the *programmer* to indent the code. If you make a mistake, it can be more misleading than unindented code! I think that these days, auto-indenting editors or seperate programs should be available. I think that emacs c-mode has saved me an enormous amount of time. If you leave off a ';' or have mismatched parenthesis it becomes immediately apparant by the indentation. If *I* had indented it, I would have indented it as I *intended* it to work. That is not to say that getting students to indent by hand mightn't be a useful *exercise*, but I think getting best use out of appropriate tools is an important skill. >Remember when you were learning to drive, and you instructor (dad) made >you keep both hands on the wheel at the 2 and 10 o'clock positions? Do >you still drive that way? Probably not, except in heavy traffic or other >situations which might require a quick response. I agree except that I don't think it is quite a good analogy. Not driving with hands at the 10 to 2 is due lazyness rather than because it is sometimes not the best way (watch any race driver). More importantly, once they have learned the skills, they should be told that they can be more flexible before they finish the course. -- Ian Dall life (n). A sexually transmitted disease which afflicts some people more severely than others.