LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 22 Jun 2006 16:07:16 +0000
Reply-To:   toby dunn <tobydunn@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   toby dunn <tobydunn@HOTMAIL.COM>
Subject:   Re: macro structure
Comments:   To: ya.huang@AMYLIN.COM
In-Reply-To:   <200606221552.k5MEm4iG010784@mailgw.cc.uga.edu>
Content-Type:   text/plain; format=flowed

Ya ,

Opps hit the send button too fast. From a design stand point the second example could said to be perfectly coupled. Which isnt what you want.

"So what did Michelangelo do when planning to paint the Sistine Chapel? The same thing you should do when faced with a big task.

Michelangelo divided his mural into panels: separate, free-standing areas, each of which tells a story. But he did so fairly carefully, such that the panels exhibit these characteristics:

High cohesion Low coupling Conceptual integrity These are things we can learn from

Michelangelo's panels have low coupling; they are all self-contained; there are no instances of figures reaching from one panel into the next, for instance. Why is that important?

If you look closely at one of the panels that portrays angels gliding about the firmament of heaven, you'll notice that one of the angels is turning his back to, and gliding away from, the other angels. You'll also notice that said angel isn't wearing any pants. He's rather pointedly "mooning" the other angels.

There is surely a tale that explains the bare tail of the mooning angel, but for now let's assume that the Pope discovered the mooning angel and demanded that it be replaced. If the panels weren't independent, then the replacement of one panel would entail replacing some adjacent panels as well—and if you had to use different pigments because the originals weren't available, maybe you have to replace the next set of panels that were indirectly affected. Let the nightmare begin. But as it stands, the panels are independent, so the offending angel (who was apparently on Spring Break) could have been easily replaced with a less caustic image and the rest of the project would remain unaffected."

From The Art in Computer Programming By Andrew Hunt and David Thomas

Toby Dunn

From: Ya Huang <ya.huang@AMYLIN.COM> Reply-To: Ya Huang <ya.huang@AMYLIN.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: macro structure Date: Thu, 22 Jun 2006 11:52:59 -0400

Hi there,

Structure 1:

%macro a; ... %mend a;

%macro main;

...

%do i=1 %to &xx; %a %end;

... %mend main;

Structure 2:

%macro main;

%macro a; ... %mend a;

...

%do i=1 %to &xx; %a %end;

... %mend main;

So for structure 1, two macro are separated in two files, %main can call %a because of the auto macro call library.

For structure 2, %a is defined inside %main, but before the looping. Is there significant benifit of 1 over 2?

Thanks

Ya


Back to: Top of message | Previous page | Main SAS-L page