Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!att!dptg!ulysses!andante!alice!garry From: garry@alice.att.com (garry hodgson) Newsgroups: comp.object Subject: Re: Functions without side effects (was Old confusion) Summary: flag on the field Message-ID: <20445@alice.att.com> Date: 24 Jun 91 19:36:40 GMT References: <130242@tut.cis.ohio-state.edu> <4888@osc.COM> <72893@microsoft.UUCP> <1991Jun21.013944.23970@netcom.COM> Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 55 In article <1991Jun21.013944.23970@netcom.COM>, jls@netcom.COM (Jim Showalter) writes: > kers@hplb.hpl.hp.com (Chris Dollin) writes: > 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? You're doing it again, Jim. This is the kind of thing that caused all the flamage about your earlier C-bashing. Your points are valid enought without resorting to knocking down straw man code fragments. Try it this way: Here we go again. The C equivalent of the above would typically look something like: Print( "I love named parameter names", 5, Laserprinter, Helvetica ); This DOES take up less space. Is it more readable? My answer might be, "No, but with the exception of the wired-in constant 5 for spacing (which should have some useful name instead), it is about equally readable." People can write good or bad code in whatever language they choose. I get tired of always hearing that all C programmers are undisciplined losers who couldn't ( or wouldn't ) write a clean line of code if their lives depended on it. ( Yes, I Know you didn't say that ). Besides, complaining about C is sort of irrelevant. C++ is here now, and provides a variety of features that make it easier to write clean and robust code. It's like us raggin' on Ada because Pascal had problems. Who cares? -- Garry Hodgson AT&T Bell Labs