News for hackers. Stuff that matters.
Re:A Different Way: Traits in PHP by Nycto on Friday September 25, 2009 @02:26PM (#844003)
I completely agree. If Traits are something you really need, you're using the wrong language. If you need a screw driver, get a screw driver. Don't try to use the claw of a hammer. Developing with something like this will only increase the spaghetti factor. If you are a stickler for code re-use, my suggestion is to favor Composition over Inheritance.

It's also worth noting that PHP will most likely be adding Traits into the core language at some point. A patch has been available since 2008:

http://wiki.php.net/rfc/traits

Hell, if you really need traits (you don't), apply the patch. Just don't mutilate your code base.

There are no comments on this comment yet.