Ioannis Vranos wrote:
> "Paul Mensonides" <> wrote in message
> news:__GdnWHWp5fKmhvdRVn-...
>>
>> This isn't a religious issue. It is a practical one. Macro names
>> should be all caps to distinguish them from everything else--for a
>> very good reason. When you use all caps for constants, you introduce
>> a loophole into the protection techniques that would otherwise never
>> fail (at least not silently).
>
>
> Well lets get into this war anyway.
At first i do not use macros
> usually in my daily code but that's another matter. Standard library
> macros like assert() are in lowercase. Only constants like NULL are
> capitals. The same convention applies both for macros and non-macros.
Those standard library macros come from C--where name clashing issues are not
nearly as significant as they are in C++ (at least as far as cutting across all
underlying language scoping mechanisms go).
> Only contants should be uppercase, and by doing this improves the
> visibility of the code.
I disagree; I think that it clutters it, and more importantly makes it less
obvious when macros are involved. However, that just goes to show the
subjectiveness of this sort of thing. A subjective choice is perfectly fine
when there is no solid objective contradiction, but in this case, there is.
> After all, a library facility macro or not,
> should not make any difference for the end user who has not to know
> about the implementation details.
No, it definitely does make a difference--consider the min/max macro case for
example. One of the arguments is always evaluated twice. That is an important
distinction that is a product of its macro nature. That is why the C standard
has to make so many guarantees about that sort of thing because just about
everything in the standard library can be a macro so long as it has a function
also.
Regards,
Paul Mensonides