Path: utzoo!attcan!uunet!decwrl!ucbvax!THEP.LU.SE!magnus From: magnus@THEP.LU.SE (Magnus Olsson) Newsgroups: comp.arch Subject: Re: religion and computer science Message-ID: <9007231504.AA10019@thep.lu.se> Date: 23 Jul 90 15:08:30 GMT References: <20955@duke.cs.duke.edu> Sender: daemon@ucbvax.BERKELEY.EDU Organization: Theoretical Physics, Lund university, Sweden Lines: 56 In article <20955@duke.cs.duke.edu>, drh@cs.duke.edu writes: >I approached my course with what might be termed a "progressive" viewpoint. >Rather than give my students lots of rigid rules about indentation, >commenting, modularization, and so forth, I decided to give a few lectures >on some fuzzy, imprecise ideas of "good style" and "maintainability" and >then let each student program in whatever way their own creativity led. >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. I think the best summary I've heard of this point of view was given by one of the CS teachers here in Lund: "You have to know the rules to be able to break them" (i.e. in a constructive way). I know the rules of structured programming (from having been forced to follow them); I break them when I think it's necessary to make the program efficient or more easily understandable (using a goto to jump out of a nested loop in Pascal is much simpler than having a lot of flags and extra termination tests, and doesn't make the program any more difficult to understand - on the contrary). I'm surprised at how seldom I have to do it. My own experience as a T.A. is that (beginning) students who aren't forced to "follow the rules" will not follow them - not because they've made an evaluation of the arguments pro/con structured programming and decided that they can write better programs if they ignore the rules (and, believe me, the only good programs produced by beginners tend to be the well-structured ones) but because they *don't understand* what the rules are there for and that they may benefit from using them. They aren't stupid - they won't waste a lot of time learning some stupid rules if they can't see the point in following them. Of course, in an ideal world, students would *first* learn so much about programming that they could write good programs, and decide for themselves if they needed the rules or not, and *then* start programming. However, to be able to decide, you have to have some programming experience, and to get that, you have to program! I think it's better to force people to follow the rules until they are sufficeintly good programmers to see the reasoning behind them. If they then decide that they don't need the rules, well, there's more than one way of skinning a cat, isn't there? Finally, let me just add that of the computer scientist I've met, some are indeed sitting in some sort of ivory tower (at least in dome aspects!) but there are also lots of CS people who are very good programmers and who really care about program efficiency, usability and so on. You just can't generalize the way some people love to do. (I'm not a computer scientist myself). Magnus Olsson | \e+ /_ Dept. of Theoretical Physics | \ Z / q University of Lund, Sweden | >----< Internet: magnus@thep.lu.se | / \===== g Bitnet: THEPMO@SELDC52 | /e- \q