Path: utzoo!attcan!uunet!world!decwrl!sdd.hp.com!uakari.primate.wisc.edu!samsung!munnari.oz.au!brolga!uqcspe!batserver.cs.uq.oz.au!brendan From: brendan@batserver.cs.uq.oz.au (Brendan Mahony) Newsgroups: comp.society.futures Subject: Re: C's sins of commission (was: (pssst...fortran?)) Message-ID: <5088@uqcspe.cs.uq.oz.au> Date: 3 Oct 90 02:26:16 GMT References: <5006@uqcspe.cs.uq.oz.au> <64616@lanl.gov> Sender: news@uqcspe.cs.uq.oz.au Reply-To: brendan@batserver.cs.uq.oz.au Lines: 38 jlg@lanl.gov (Jim Giles) writes: [a good exposition of the nature of side effects] >In any case, the user community seems to regard the ability to have >functions with side-effects as indispensable It seems to me that this attitude could reasonably be likened to the antiquated European belief that regular bathing was dangerous to the health. Indeed we now believe that bathing is good for the health provided the water supply is clean and hygenic. The percieved need for side-effects in terms is merely a by-product of the poor state of language design, and would not be missed at all in better languages. The purpose of terms is to define values. In serving this purpose they need above all to be UNAMBIGUOUS. Terms with side effects are ambiguous. >This means that the >language designer must think about this issue very carefully. I still >support allowing functions to have side-effects - but only if the nature >of their side-effects are clearly described in the 'function prototype' >or 'interface' or whatever you decide to call it. Actually to do this you will need to specify the local/global state being side effected by the function. Since this is required why not "officially" include it in the interface? >(and, at least with regard to random number generators, I tend to agree). I have discussed random number generators elsewhere, but I do not see how using a procedure instead of a function is such a burden that we must admit ambiguous terms. -- Brendan Mahony | brendan@batserver.cs.uq.oz Department of Computer Science | heretic: someone who disgrees with you University of Queensland | about something neither of you knows Australia | anything about.