Re:The Unix Philosophy
by anewhnaccount on Thursday June 25, 2015 @12:18PM
(#9778980)
Can you explain how exactly Java and C++ have poor support for composition? Classes can have member variables in both languages. What else is there?
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.
Re:The Unix Philosophy
by marvel_boy on Thursday June 25, 2015 @02:44PM
(#9780059)
Objective-C is years along of Java extending existing classes.
That's true as far as it goes, but you can write beautiful code in most languages too, even Java. The point I was making is just that "able to write bad code" is a poor metric for a philosophy. And also that "bad unix-style pipe hackery with script glue" has the advantage of actually working more often than bad code produced by other disciplines.
The main issue that most of the common programming languages in use notably Java and C++ have very poor support for composition thus forcing developers to have to extend things.