Re: Extensions calling C++

From: Date: Sun, 09 Jul 2000 21:46:18 +0000
Subject: Re: Extensions calling C++
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-23960@lists.php.net to get a copy of this message
I answered Sascha in person. The summary of the 'operative' part of my reply to him was that I have no idea whose 30 years of experience he was referring to (definitely not his, his age is only slightly higher than half that time); That there are quite a few examples to people/projects employing this style (MFC & Stingray, to name a couple of huge ones); And that quite frankly, I don't care, since it looks nicer and makes the code flow significantly better. IMHO, having macros without parentheses that cause side effects inside code, looks almost as ugly as #ifdef preprocessor directives and the likes. It breaks the code flow. Zeev At 00:10 10/07/2000, Sascha Schumann wrote:
On Mon, 10 Jul 2000, Zeev Suraski wrote: At 23:56 09/07/2000, Sascha Schumann wrote:
Some parts of Zend use C++. But I dislike the () behind the *_EXTERN_C macros which are otherwise quite convenient.
We seem to have a disagreement about this one. Personally, I think that any macro that has side effects (i.e., any macro which is anything beyond a definition of a static value), should have parentheses at its end. It makes the code *MUCH* more readable. Unfortunately, not all of the PHP 3.0 macros respected this standard (e.g., RETURN_FALSE, which should have been RETURN_FALSE()), but we're definitely pushing that any new macros would use this convention. Unfortunately, thirty years of C development disagree with you. What a macro does should be obvious from the macro name.
-- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.dev (#23960) next »