|
Ron:
While my example was a seven step program, I should have put it in terms of a 12 step program, starting with "My name is Mark and I am a sloppy programmer. It's been ten days since I last (knowingly) did sloppy code.".
Yes I do from time to time write or work with long programs, especially during development. Modularization often takes place later. Often it's a matter of inheriting code, sometimes it's wholly autonomous.
All:
I appreciate the fact that issuing a macro definition can simulate nested comments. Receiving this suggestion so quickly from multiple people just shows that SAS-L is the right place to get answers to "how to" questions - in this case "how to get around a SAS deficiency".
I had neglected that technique - which I now recall actually using in the past - when I posted my note. I was more focused on how to remove the deficiency rather that how to live with it.
However, I would argue that SAS can (and probably should) introduce a specific nested comment syntax, because it is more ...
... COMPLETE: It works when the NOMACRO option is in force (the %macro ... %mend techique fails). It also works for commenting PARTS of sas statements (which might have been a better context for justifying the original suggestion).
... PARSIMONIOUS: It would avoid the need for SAS macro to be called.
... INTUITIVE: And it would make it easy for new or forgetfull (like me) users to find this capabiity actually documented in "comments" section where it belongs.
However, I am also convinced this is a minority opinion.
'Nuff said and thanks for comments.
Mark
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
> Fehd, Ronald J. (CDC/OCOO/ITSO)
> Sent: Tuesday, July 20, 2010 2:57 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: FW: Thoughts on nested comments?
>
> \begin{OpEd}
> <insert tongue firmly in cheek>
>
> Truly: Badness Happening!
>
> <one of Donald Knuth's favorite tag-lines in his TeX typeseting
> system;
> used in place of Warning>
>
> Your commentary and description of how you want to use this shows an
> under-developed method of writing
> * modules
> * routines
> and
> * subroutines
>
> One Big Program?!
>
> go for small bytes when programming.
> Small programs -- routines and subroutines -- are easier to
> * develop
> * debug
> * test:
> * unit test
> * integration test
>
> \end{OpEd}
>
> Ron Fehd the testing maven
>
> > -----Original Message-----
> > From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-
> > l@listserv.uga.edu] On Behalf Of Keintz, H. Mark
> > Sent: Tuesday, July 20, 2010 1:31 PM
> > To: SAS-L@LISTSERV.UGA.EDU
> > Subject: Thoughts on nested comments?
> >
> > Folks:
> >
> > This is an informal request to SAS-L for thoughts on a nested comment
> > mechanism. I.e. if the next sasware ballot included an item like
> > "introduce nested comments", how might the feature look in practice?
> >
> >
> > JUSTIFICATION:
> >
> > AFAIK, SAS does not support nested comments. In particular a single
> > "*/" cancels the effect of any number of preceding unpaired "/*"
> > delimiters.
> >
> > I for one would appreciate the ability to nest comments. When
> > developing, say, a 7-step program I may have steps 3 and 5 already
> > vetted and each therefore commented out via "/* ... */". If, after
> > further testing, I want to comment out steps 2 through 6, I can't
> > simply insert delimiters before step 2 and after step 6.
> >
> >
> > PROPOSAL:
> >
> > Add //* and *// as nested comment delimiters, such that:
> >
> > //* Increases the comment level by 1
> > *// Decreases the comment level by 1
> >
> >
> > EXAMPLE: using the 7-step program mentioned above, I start out with
> > steps 3 and 5 commented with the proposed tokens.
> >
> > ... step 1 SAS code ...
> > ... step 2 SAS code ...
> > //*
> > ... step 3 SAS code ... treated as a comment (level 1)
> > *//
> > ... step 4 SAS code ...
> > //*
> > ... step 5 SAS code ... treated as a comment (level 1)
> > *//
> > ... step 6 SAS code ...
> > ... step 7 SAS code ...
> >
> > Subsequently I want to comment steps 2 through 6. I would add //*
> > before step 2 and *// after step 6:
> >
> > ... step 1 SAS code ...
> > //*
> > ... step 2 SAS code ... treated as a comment (level 1)
> > //*
> > ... step 3 SAS code ... treated as a comment (level 2)
> > *//
> > ... step 4 SAS code ... treated as a comment (level 1)
> > //*
> > ... step 5 SAS code ... treated as a comment (level 2)
> > *//
> > ... step 6 SAS code ... treated as a comment (level 1)
> > *//
> > ... step 7 SAS code ...
> >
> > CONSIDERATIONS:
> > 1. This feature should not be allowed to break the behavior of /*
> and
> > */. In particular all comment levels established by //* would be
> > subordinate to the effect of */, which would terminate all levels.
> >
> > 2. I know of no usage of the token "//*" in current SAS programs,
> and
> > an unpaired "*//" would be treated the same as an unpaired "*/". So
> > IMO these particular tokens are highly unlikely to be present in
> > current programs. I.e. they shouldn't break any current code.
> >
> >
> >
> > (Ahem) Comments?
> >
> >
> > regards,
> > Mark
|