Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!edcastle!aiai!jeff From: jeff@aiai.ed.ac.uk (Jeff Dalton) Newsgroups: comp.lang.scheme Subject: Re: Why macros impair readability (long) Message-ID: <4290@skye.ed.ac.uk> Date: 9 Mar 91 21:30:52 GMT References: <9103041928.aa21342@mc.lcs.mit.edu> Reply-To: jeff@aiai.UUCP (Jeff Dalton) Organization: AIAI, University of Edinburgh, Scotland Lines: 72 The intention is to add macros, and its just a matter of unfortunate timing that they're not there already. That it is unfortunate is shown by (among other things) the recent messages arguing against macros. If Scheme already had macros, we'd be able to spend our time discussing how to write good, readable macros instead. Anyone who doesn't like macros or thinks they're unreadable doesn't have to use them. They'll have a choice. On the other hand, if they're not in the language those of us who want to use them can't. No choice, unless we want to write non-portable code. In article <9103041928.aa21342@mc.lcs.mit.edu> lyn@altdorf.ai.mit.EDU (Franklyn Turbak) writes: > Given the above, it's easy to see how discussions about readability >can easily degenerate into religious squabbles. If everyone assumes >his/her own interpretation of "readable" and "reader", then people >aren't really debating the same issue. I disagree almost completely that that is the problem. Of course, some people do have strange notions of what "readable" means. For example, you seem to think it should mean "easy to reason about locally". I think that in part you are confusing the question of the definition of readability with that of what counts as a good reason for claiming something is readable. Readability has an inherant subjective component, but it is not entirely subjective. In particular, if there's a question about whether something is readable, there can be good reasons for saying it is or is not. It is not just a matter of saying "I find it easy to read, so it's readable". "Easy to reason about locally" would count as a good reason. That doesn't mean we should consider it a _definition_ of readability, however. > I also do not claim that introduction of macros into a program >always makes it less readable. There are many situations where a >judicious use of macros makes code more understandable by abstracting >over the particular mechanism that implements a behavior. Yes, but you want to create the impression that on the whole macros make things worse as far as readability is concerned. And note that here you're going back to what we might call the naive notion of readability -- or are you saying that macros sometimes make it easier to reason locally? >(Unfortunately, macros are notoriously hard to write well; macrology >is quite a black art.) Some macros are hard to write well, others are not. > Note that in three of the four points raised above, Jaffer's >syntactic distinction idea seemed well-motivated. This conclusion is >based on my particular assumptions. Of course, there are other >assumptions and models under which macros improve reasoning and >macro/procedure syntactic distinction unduly complicate programs. I >entreat people to make such assumptions and models explicit in their >readability arguments, and to make liberal use of examples in illustrating >their viewpoints. That's certainly a way to make it as hard as possible for someone to argue that macros are readable. I hope that we don't have to make such arguments at all, and that macros will be added to Scheme regardless. N.B. I agree that macros introduce new problems for local reasoning and with the parts of your article devoted to that point. -- jd