Hi,

Steph Fox schrieb:
All I'm seeing here is people with CS degrees saying trait would be cool. What about us peasants? Or am I the last living peasant? :\ That's possible, I suppose.

Sell it to me?
A very cool thing of traits is the flattening property ensuring that there is no difference between a method from a trait imported to the class and a method defined in the class. Ok, there are people trying to mess up the notion proposed by additional complexity. But based on the original proposal made by me, traits can be seen as a language supported copy'n'past mechanism, like some complex macro copying the traits methods to a class body (with those excluding and aliasing features added).

In the implementation for the Squeak Smalltalk language, they have introduced a modified class browser. The class browser is the embedded IDE of the Smalltalk guys, with similar features as the outline view of eclipse. To avoid the need for developers to struggle with traits if they don't know about or do not like them, they build a class browser which only shows the flattened view on the classes, including all methods from traits but avoiding to annoy the developers with the trait notion.

This is possible to be implemented in the Eclipse PDT, too.
Some Java guys have already demonstrated a comparable implementation for the Java part of IDE to demonstrate traits for Java. In my opinion, traits is a thing developers has only to be aware of if they really did like to use them. (iff proper tool support is available. Guess it wouldn't be that way for VIM users, for example)

Kind Regards
Stefan

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

Reply via email to