News for hackers. Stuff that matters.
Re:The Unix Philosophy by spiralpolitik on Thursday June 25, 2015 @02:04PM (#9779752)
Example: How in Java do you add a method to the String class so that all instances of String gain the method without extending String and introducing a new subtype ?

It cannot be done. As an example see Categories in Objective-C.

Java's support for composition has improved somewhat with default methods on interfaces in Java 8 but it's still poor compared to the above languages. This leads to the "abundance of classes" anti-pattern you see with Java projects as you are forced to extend to introduce new functionality.

There are no comments on this comment yet.