Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!ai-lab!zurich.ai.mit.edu!markf From: markf@zurich.ai.mit.edu (Mark Friedman) Newsgroups: comp.lang.scheme Subject: Re: Why macros impair readability Message-ID: Date: 7 Mar 91 19:32:46 GMT References: <9103071300.aa28959@mc.lcs.mit.edu> Sender: news@ai.mit.edu Reply-To: markf@zurich.ai.mit.edu Organization: M.I.T. Artificial Intelligence Lab. Lines: 49 In-reply-to: lyn@altdorf.ai.mit.EDU's message of 7 Mar 91 17:59:13 GMT In article <9103071300.aa28959@mc.lcs.mit.edu> lyn@altdorf.ai.mit.EDU (Franklyn Turbak) writes: This a response to Mark Friedman's evaluation of my analysis of macro readability: I agree wholeheartedly; No no Alphonse, I agree with you wholeheartedly :-) You say that macros are just another abstraction mechanism that do not qualitatively change the rules of the game. What I meant was not that macros are JUST another abstraction mechanism, but that there are other things in Scheme which complicate the rules (e.g. side effects and call-with-current-continuation). We accept them (and sometimes scorn them) because of their power, just as we should accept (and sometimes scorn) macros. But then why is it that syntactic abstraction and procedural abstraction evoke such different responses with regard to readability. I rarely (if ever) hear programmers complaining that code was hard to read because it contained procedures, but *do* hear programmers making these kinds of claims about macros. I think that Scheme programmers are more aware of the pitfalls of things like side effects and call-with-current-continuation than they are of macros. To that end, this whole discussion (especially your part) is incredibly useful. If you look at code written in Scheme (or more likely Common Lisp) with a "Fortran style" it is often very difficult to read. The combination of procedural abstraction with side effects to global variables can be deadly. A former Fortraner could (weakly) argue that the problem is the modularization into procedures. The code would probably be clearer is it were clumped together because we sort of expect that separate procedures act upon separate local state. Of course a Schemer would (strongly) argue for getting rid of the global variables. -Mark -- Mark Friedman MIT Artificial Intelligence Lab 545 Technology Sq. Cambridge, Ma. 02139 markf@zurich.ai.mit.edu