Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!uunet!visix!news From: amanda@visix.com (Amanda Walker) Newsgroups: comp.object Subject: Re: named parameters and verbosity [was: Functions without side effects] Message-ID: <1991Jun27.052157.2291@visix.com> Date: 27 Jun 91 05:21:57 GMT References: <130242@tut.cis.ohio-state.edu> <4888@osc.COM> <72893@microsoft.UUCP> <1991Jun21.013944.23970@netcom.COM> <20445@alice.att.com> <1991Jun26.001847.24239@netcom.COM> <1991Jun26.185707.26149@visix.com> Sender: news@visix.com Organization: Visix Software Inc., Reston, VA Lines: 29 adam@visix.com (Adam Kao) writes: I almost never put raw constants in my code, both because of the thin semantics and because changing the constants becomes a ridiculous hunt-and-kill exercise. ("Search-and-replace: 5 [CR] with: 6 [CR]"). I agree (which may not be a surprise :)). Use of macro-defined and enumerated constants is an important aspect of good coding style, in C as in any other language. One of the things I like about Common Lisp is the way it handles "keyword arguments." In particular, you can often write functions that have a useful mixture of implicitly and explicity labelled parameters. For example: (make-array '(2 2)) makes an uninitialized array (or perhaps one initialized to some default value), while (make-array '(2 2) :initial-contents '((1 2) (3 4))) makes one with the specified initial contents, and so on. -- Amanda Walker amanda@visix.com Visix Software Inc. ...!uunet!visix!amanda -- "I have never seen anything fill up a vacuum so fast and still suck." -- Rob Pike commenting on the X Window System