Re: Re: [VOTE]Call for voting: support use list in foreach
| From: | Andrew Faulds | Date: | Mon, 27 Aug 2012 08:00:01 +0000 |
| Subject: | Re: Re: [VOTE]Call for voting: support use list in foreach | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-62557@lists.php.net to get a copy of this message | ||
Hi.
I haven't really tried much of C++ to be honest, but its sheer size and complexity means we
should best avoid it, IMO. It can be confusing enough trying to understand some parts of the Zend
engine without having to deal with operator overloading, templates and so-on. C is small enough
that, aside from some of the complex undefined behaviour involving integer overflow and such, I can
remember most of the language itself, making development much easier. And sticking with C89 means
there's also great compiler support - C99 still isn't fully supported in GCC, 13 years
after standardisation! C++ has better support, of course, but C++'s magic and abstractions
don't seem appropriate.
--
Sent from Samsung Mobile
Andrew Faulds
http://ajf.me/
Stas Malyshev <smalyshev@sugarcrm.com> wrote:
Hi!
> That's where it gets ugly, in my experience; there are lots of
> mediocre C++ developers (and legions of even expert
> PHP/JavaScript/Python/Ruby/etc. devs) who couldn't so much as use a
> pointer without <insert favorite C++ pointer wrapper here> around to
> check their NULLs and do their deletes for them.
As a person who used both C and C++ and had to figure out others' code
written in C and C++, my experience is that C code is usually easier to
figure out (unless it's written in some heavily macro-ed style -
remember that C preprocessor is a separate functional language and if
you mix the two you can make some fine mess there) because C++ has tons
of magic you have always to keep in mind. Operator is never just an
operator, assignment is never just an assignment, pointer dereference is
never just a pointer dereference. There's magic in all of that. And
don't get me started on multilevel templates and trying to figure that
out. Of course, C++ gives you a nice means of hiding complexity. But if
you're not careful, you'd hide it in a way that it's still there, but
you are no longer able to figure out where it is. So if somebody thinks
C++ is a panacea here - probably not. Some pieces of Zend Engine are
genuinely complex because they do complex things. I don't think hiding
it behind C++ would help us much. Yes, we'd earn some with making zval
an object, but probably not as much as one would think.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php