3 ms·
> Sun could have (and should have) copied them in Java, and I don't know why they didn't. I had always assumed that, initially, Sun was distracted by the Oracl
by signal11 9y ago
> Sun could have (and should have) copied them in Java, and I don't know why they didn't.
I had always assumed that, initially, Sun was distracted by the Oracle acquisition. But there's also a philosophical / design principle in Java which tends towards being conservative about what features they add, for instance see this discussion thread [1,2] about adding a Pair class into java.util. Given the wide deployed footprint of Java across platforms, one can even sympathize with this.
There is also the central Java philosophy (which also influences the Pairs/Tuples discussion) that "names matter"[3]. I would argue that in my experience, in some contexts, especially in the server-side enterprise context where Java is very popular, names don't always matter, which is why developers keep asking for Pairs and Tuples and keep complaining about Java's verbosity -- because Java forces them to care about things they don't really care about (another great example is checked exceptions).
C# to me is like a "mirror universe" Java, where the underlying philosophy is to add features if they make a developer's life simpler. As a result, C# "feels" nicer to use and in the right hands can result in (subjectively) nicer code. In JVM land, this also explains why so many developers like Kotlin.
In reality, developers can write unreadable code in both languages. Although my main criticism of Java is that they probably shouldn't be that dismissive of Lisp, there are some good ideas there, as Kotlin has been demonstrating :-).
In any case, Java is now on a rapid-release cadence[4] where we should see more "features" added on a regular basis.
[1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2010-March/003995.html http://mail.openjdk.java.net/pipermail/core-libs-dev/2010-Ma...
[2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2010-March/003996.html http://mail.openjdk.java.net/pipermail/core-libs-dev/2010-Ma...
[3] http://cr.openjdk.java.net/~briangoetz/amber/datum.html http://cr.openjdk.java.net/~briangoetz/amber/datum.html
[4] https://www.infoq.com/news/2017/09/Java6Month https://www.infoq.com/news/2017/09/Java6Month