Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!lll-winken!aunro!alberta!ubc-cs!uw-beaver!fluke!ssc-vax!dmg From: dmg@ssc-vax (David M Geary) Newsgroups: comp.object Subject: Re: Functions without side effects (was Old confusion) Message-ID: <4174@ssc-bee.ssc-vax.UUCP> Date: 21 Jun 91 18:22:52 GMT References: <1991Jun19.173 <1991Jun21.013944.23970@netcom.COM> Sender: news@ssc-vax.UUCP Reply-To: dmg@ssc-vax.UUCP (David M Geary) Organization: Boeing Aerospace & Electronics Lines: 59 In article <1991Jun21.013944.23970@netcom.COM> jls@netcom.COM (Jim Showalter) writes: akers@hplb.hpl.hp.com (Chris Dollin) writes: ] ]>I'd choose a different name for the procedure: this ensures that the ]>keyword-syntax cannot be accidently left out (not being there). Of course this ]>gets harder as the number of arguments increases. ] ]It gets unacceptably ugly as the number of arguments increases above 1, which ]means that in the typical case, you want named parameters: ] ] Print (This_Comment => "I love named parameter names", ] With_This_Spacing => 5, ] On_This_Device => Devices.Laserprinter, ] In_This_Font => Fonts.Helvetica); ] ]and so forth. I find this considerably better than a name like ]Print_Comment_With_Spacing_Device_and_Font_Toggles or some such. ] ]>It can be too verbose to *read* as well. If it makes code unecessarily large, ]>that is in and of itself a maintenance problem. ] ]Here we go again. The C equivalent of the above would typically look ]something like: ] ] prnt("I love named parameter names",5,lsptr,hlvtca); ] ]This DOES take up less space. Is it more readable? ] Jim, Jim, Jim. Come on now, play fair. How about: prnt(/* This Comment */ "I love *commented* parameter names", /* With This Spacing */ 5, /* On This Device */ lsptr, /* In This Font */ hlvtca); BTW, why such wonderously readable *variable* names for the Ada example: ] Print (This_Comment => "I love named parameter names", ] With_This_Spacing => 5, ] On_This_Device => Devices.Laserprinter, ^^^^^^^^^^^^^^^^^^^ ] In_This_Font => Fonts.Helvetica); ^^^^^^^^^^^^^^^ and such terse variable names for the C example: ] prnt("I love named parameter names",5,lsptr,hlvtca); ^^^^^^^^^^^^ Oh, yeah, I forgot; C is only used by a bunch of lowlife hackers who revel in unreadable code... -- |~~~~~~~~~~ David Geary, Boeing Aerospace, Seattle, WA. ~~~~~~~~~~| |-----------------------------------------------------------------------------| |~~~~~~ Seattle: America's most attractive city... to the *jetstream* ~~~~~~| |-----------------------------------------------------------------------------|