Re: A challenge for RosAsm



On Wed, 29 Jun 2005 22:09:57 -0400, Frank Kotler <fbkotler@xxxxxxxxxxx>
wrote:
>wolfgang kern wrote:
>> My opinion about Macros:
>>
>> * + reduces source size
>
>Mmmm, "%define REALLY_LONG_NAME_FOR_A_SMALL_INTEGER 0"
>doesn't even do that...
>
>> - on cost of 'direct readability'
>
>Macros *can* improve readability (a matter of opinion, of course).
>
>> - bloats the .exe (in hidden form)
>
>Not always. Suppose I use the asmutils macro:
>
>sys_write stdout, msg, msg_len
>
>If I define "Linux" or "BSD" on Nasm's command line, I get appropriate
>code for either OS - just what's needed, no bloat. Compared to the
>alternatives, either providing both versions and switching at runtime,
>or linking against libraries for portability, that's *less* bloat.
>
>> * + minor convenience for lazy programmers
>
>In some cases, not so minor...
>
>> * - any change in it will affect many program parts.
>
>This can be an advantage! Do you really want to scan through your code
>changing each instance?
>
>> So if I need several similar code parts, I either
>> write one routine which cover all wanted variations, or
>> I just copy/paste and modify as desired.
>
>Okay - a macro can do the copy-paste-modify automatically, and
>accurately(!)... if properly used.
>
>> And I never would hide any code block, as parts and trails
>> often can be used more than one time, so I must see it.
>
>Well, I like to see my code too. I'm not a *huge* fan of macros. I've
>seen a lot of code using macros "badly"(IMO) which has exactly the
>effects (defects!) you describe. But I wouldn't issue a blanket
>comdemnation on that account - any tool can be misused.
>
>Properly designed, and properly used, macros *can* show an "improvement"
>in the very areas you mention. Not all macros are created equal.
>
>Well, ya *knew* you weren't the only one with an opinion :)
>
>Best,
>Frank

now i think:
95% of programming is pure assembly and not many macro (that are build
in the way: if I see them I can see the extension in my mind) for doing
routines

5% of programming is find *useful routines relations*, and the reuse
of code (so use some hll language like c++ perl etc for classes etc)

.



Relevant Pages

  • Re: Basic questions
    ... >>that this convention DOES cause problems with name clashes, ... If the convention of reserving ALL_CAPS for macros is followed, ... > than uppercase is still opinion, even though it's a red herring. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Fexprs more flexible, powerful, easier to learn? (Newlisp vs CL)
    ... Majorinc Kazimir schrieb: ... powerful than macros? ... Will your code eval the first two args in any case? ... This version is even better than yours in my opinion. ...
    (comp.lang.lisp)
  • Re: Testing the case of a letter
    ... Huh? ... I think that was a big misunderstanding. ... I thought you were asking about my opinion while you seem ... I could expand the macros a little to give a few ...
    (comp.text.tex)
  • Re: AutoOpen not Executing When Document Macros Disabled
    ... Normal.dot is already opened and accessible, so the macros therein ... execute regardless of enabling macros within the document? ... another template has code in that template's Document_Open event... ... public routines and two private routines. ...
    (microsoft.public.word.vba.general)
  • Re: Saving VBA Code Best Practice
    ... those other routines Private. ... Good practice is to have only a very few Public Subs in each module (note ... You will only see a macro at Tools> Macros> Macros if it: ... I wrote a couple subroutines that perform different actions. ...
    (microsoft.public.word.vba.general)