Richard Quadling schrieb:
On 21/02/2008, Richard Lynch <[EMAIL PROTECTED]> wrote:
 In fact, new users are often confused because the CAN'T do an include
 in the middle of a class -- A rule which, to some, seems arbitrary and
 illogical.

And once they understand (if they do) why they cannot use "include",
they want to know how to do it anyway.

Traits answer this quite nicely. All be it in a way which the idea of
include would solve if it was done at parse/compile time.

So, maybe something as simple as

class_include 'file.inc';

We even would not need a new keyword, we could use "include" for this. The user would not really care if this is compile time or run time as long as the simple (and most useful) case Just Works IMHO.

But having said that traits LOOK nice. They look clever.

Is it over complicated? If you don't know OOP, then maybe. But hell if
everything was easy we would have monkeys doing it all for us.

I'm trying to suppress my reservations about new language constructs and was quite succesful: I started to like Traits. But the discussion about the semantics are close to making me reconsider: If you (the core developers and language designers) cannot agree on the semantics (stateless vs. stateful traits, etc.) I wonder how the user is going to feel about it.

Traits look good. Many userland developers would use them. Many more

The use case examples I've seen so far haven't been all that convincing to me but that's probably because of a different coding style.

- Chris

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to