Re: A challenge for RosAsm
- From: asetofsymbols@xxxxxxxxx
- Date: 29 Jun 2005 23:29:01 -0700
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)
.
- Follow-Ups:
- Re: A challenge for RosAsm
- From: asetofsymbols
- Re: A challenge for RosAsm
- References:
- A challenge for RosAsm
- From: Randall Hyde
- Re: A challenge for RosAsm
- From: Betov
- Re: A challenge for RosAsm
- From: Randall Hyde
- Re: A challenge for RosAsm
- From: Betov
- Re: A challenge for RosAsm
- From: Randall Hyde
- Re: A challenge for RosAsm
- From: wolfgang kern
- Re: A challenge for RosAsm
- From: Frank Kotler
- A challenge for RosAsm
- Prev by Date: Re: Article about HLA on Linux Journal's website
- Next by Date: Re: A challenge for RosAsm
- Previous by thread: Re: A challenge for RosAsm
- Next by thread: Re: A challenge for RosAsm
- Index(es):
Relevant Pages
|