Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!munnari.oz.au!metro!usage.csd.unsw.oz.au!syacus!ian From: ian@syacus.acus.oz (Ian Joyner) Newsgroups: comp.lang.pascal Subject: Re: Gotos are ok (Was Re: IMPLEMENT GOTO ACROSS MODULES IN TURBO PASCAL??) Message-ID: <1991Jan28.233252.4890@syacus.acus.oz> Date: 28 Jan 91 23:32:52 GMT References: <11656@j.cc.purdue.edu> <7147@tekgen.BV.TEK.COM> <11661@j.cc.purdue.edu> <1991Jan10.031015.15282@cs.mcgill.ca> <1991Jan10.122222.1013@uwasa.fi> <1991Jan16.005523.28337@syacus.acus.oz> <1991Jan17.205508.16059@massey.ac.nz> <1991Jan18.141406.386 Organization: ACUS Australian Centre for Unisys Software, Sydney Lines: 34 5@maytag.waterloo.edu> dmurdoch@watstat.waterloo.edu (Duncan Murdoch) writes: >In article <1991Jan17.205508.16059@massey.ac.nz> T.Moore@massey.ac.nz (T. Moore) writes: >> >>I don't think you are as far apart as you think. The operative word is >>underlined above. If possible, a program should be tree structured which >>essentially means not using spaghetti code. >I don't think a program should be tree structured. Perhaps a routine should >be, but certainly not a whole program. Programs should be onion-shaped: a >few routines at the top for general control, widening out into specialized >fairly high level routines for specific tasks, and then narrowing in again to >a common library of low-level routines, to maintain a constant interface >to the user and the data. Neither paradigm is far from my thinking, as I have thought in both of those ways, but now I think in the OO paradigm, which I think will accomodate both, but also allow you to arrange things without the shakles of either. OO allows you to put the right things in the right place, and helps avoid unwanted interdependencies (no globals has already been mentioned. If you find yourself tempted to use globals, maybe you have discovered another class!) I think T.Moore's original point was correct, we were not that far apart after all! Unfortunately, OO has suffered in the same way as the goto avoidance debate, in that it has seemingly become a religious thing, and the original good idea is lost beneath some silly unreasoned war. Now if we can get back to the real reasons..... -- Ian Joyner ACSNet: ian@syacus.oz ACUS (Australian Centre for Unisys Software) DNS: ian@syacus.oz.au Tel 61-2-390 1328 Fax 61-2-390 1391 UUCP: ...uunet!munnari!syacus.oz