| What is wrong with macros is:
1. Macros themselves are impossible to debug, and code written with macros
can be quite difficult to debug.
2. People do not usually use macros to do anything that can't be done using
the facilities of the language itself.
3. Macros essentially redefine a part, small or maybe not so small, of the
language. This makes the macro-infested code more difficult to understand.
4. Macros can break the type-safety of the expressions they encode.
5. Clearly defined layers of abstraction can be created by writing
appropriate classes or functions without any of the untoward side effects of
macros.
6. Macros undoubtedly produce highly efficient code, but inlined functions
are exactly as efficient.
I have found through years of experience that writing code in a very
straightforward, uncompressed, text-book style, paying a lot of attention to
naming functions and variables, avoiding macros and other complex
constructions, and allowing the compiler to take care of optimization, is a
good approach. I can write such code quickly, it is easy to understand after
the fact, and the compiler usually makes it faster than I can make it by
trying to get fancy. I find in addition that relying heavily on the highly
standardized, highly debugged core of the language is easier, safer, and
faster than using fancier features. For example, in C++, I tend to avoid
operator overloading, use only simple exception handling, and use regular
"for" loops for iterators rather than creating special iterator classes.
-----Original Message-----
From: J P Fitch
To: Nicola Bernardini
Cc: Csound mailing list
Date: Sunday, January 17, 1999 9:13 AM
Subject: Re: b (ignore first)
>If you changed the sources have you ever thought of helping the community
>and reporting what was changed?
>
>Personally i do not see what is wrong with macros as they can be very
>helpful in abstraction.
>
>==John ff |