7 ms·
Proposal for generics over primitives needs a rethink
- matt2000 12y agoFor reference, here's a fairly detailed response: http://mail.openjdk.java.net/pipermail/valhalla-dev/2014-December/000475.html http://mail.openjdk.java.net/pipermail/valhalla-dev/2014-Dec... Site note: I liked how both authors took pains to be respectful in their tones, keeps the focus on the issues at hand and avoids people getting irritated with one another.
- deleted 12y ago[deleted]
- guelo 12y agoI thought the response was needlessly combatative, http://mail.openjdk.java.net/pipermail/valhalla-dev/2014-December/000475.html http://mail.openjdk.java.net/pipermail/valhalla-dev/2014-Dec...
- zeendo 12y agoAgreed. Gavin's post didn't seem to acknowledge that this was a proposal and seemed to belittle the work put into it...but I found Brian's overly defensive (though I agree with his conclusion). Having seen Brian's stewardship talk at ClojureConj, and now this, it seems clear that he feels the need to be defensive against the non-Java JVM languages out there.
- diltonm 12y agoI vote for not making the language more complicated than it already is in Java 7. Oh but we have Java 8 with closures and stuff, well OK how about no more complicated than Java 8. Please? Instead maybe introduce useful things that make programmers more productive. How about implicit generics. Where this whole mess of T and Any and <: extendsT< gobbldygook> melts away. Notice how a new class extends Object automatically? It always has. Why do I have to muck about with all the fancy and overly complex syntax. Give me the features of all of that but abstract it away so I can just write what I need to and it works implicitly. Either that or just leave the dang language alone and go make some cool libraries.
- craigching 12y agoI rather like closures and streams quite a bit! Please do continue to improve the language, especially generics! Generics as they currently are are just so much more limited than they could be. I hope they end up fixing them and getting things moving forward again with respect to generics!
- kyllo 12y agoAnd how about some support for object literals, please...?
- aardvark179 12y agoCollection literals have been explored by http://openjdk.java.net/jeps/186 http://openjdk.java.net/jeps/186, have a look at the mailing list discussions on that.
- kyllo 12y agoI appreciate the link, but this information is not terribly encouraging. Steve Yegge somewhat famously pointed out how painful Java's lack of object literals is back in 2006, and some mailing list discussion is all the progress that the Java community has made toward that feature in the 8 years since. http://steve-yegge.blogspot.com/2006/09/bloggers-block-4-ruby-and-java-and.html http://steve-yegge.blogspot.com/2006/09/bloggers-block-4-rub...
- Afforess 12y agoI am really rather tired of the appeal to simplicity that is often made in language design. Simplicity is not a virtue in a programming language. Consistency is a virtue, but not simplicity. Simplicity is a tradeoff that takes away power and control from the programmer and gives it to the computer. Computers don't need to be more powerful, programmers do. The tradeoff is a poor one and rarely worth the little gained. In this case, what do we gain by not adding primitive value types in Java? The fact that you sleep better at night because the language is more "clean"? Why should we want that? Sleep is definitely important, but the idea that a language can be too complex is silly. It does matter that new additions do remain consistent with the overall architecture, but there is no reason to advocate less features simply because you find the idea of learning something new disconcerting.
- eropple 12y agoThe response by Brian Goetz[1] is kind of unpleasant and combative. Moreover, the ideas in it kind of encapsulate why I'm growing more and more uncomfortable with relying on the JVM to keep up with my needs in the future. > The cost of the C# approach is that existing classes could not be gradually migrated to be generic; existing collections had to be effectively deprecated and replaced, or a "flag day" had to be declared where all the code (library and client) changes simultaneously. These are not options for us. This is why, despite doing it in my day job, I'm not high on the JVM's future as it stands right now. Compatibility uber alles is not a virtue, even Microsoft gets that these days. Saying "on 1 Jan 2017 we're pushing Java 10, and you will need to recompile your dependencies to upgrade" is not a bad thing. No, many people won't upgrade immediately. That's true. But they already don't! It takes years for consumers to catch up with the newest version of Java (for reasons that do not reflect well on those consumers). Why should I, as a consumer, care about them? Why should I, as a consumer, continue to use your product when you would care about laggards more than me? I mean, Oracle's welcome to, it's their business, but why would I respond positively to that? But he says that a flag day means they "hate their users." No, it would mean they are going to firewall off the damage laggards can do to their environment and ecosystem. And for the sake of a healthy platform for the next decade I would think they should do exactly that, because those laggards don't make the ecosystem and the environment better. And then, at the very end: > And, feel free to prove us wrong! Try implementing the changes you are envisioning in the JVM, and show how they can get us to the goal! Why should I, guy-who-works-for-Oracle? I'm not drawing a paycheck from Oracle, who owns Java so utterly and wants to attack and damage related tools and platforms (hi, Android), and guess what? I really don't need Oracle to fix this because in 2015 I am going to have options. Microsoft is releasing an open-source CLR for OS X and Linux and it's effectively substitutable for just about anything I care to use (and, if I had to be honest, a combination of C# and F# are probably better than even Scala for what I do). This is Oracle's problem and Oracle's ground to lose, not mine. Two-thirds of my Github are C# and Ruby at this point, anyway, and I don't even use C# for work. [1] - http://mail.openjdk.java.net/pipermail/valhalla-dev/2014-December/000475.html http://mail.openjdk.java.net/pipermail/valhalla-dev/2014-Dec...
- skybrian 12y agoIt sounds like you do hate Java's users. You dismiss the difficulty of upgrading existing apps, which is an enormous amount of work, without even making a rough estimate of how hard it would be. They are just "laggards" to you. At least consider that others may have different values than you and actually care about these people. Sacrificing backward compatibility means adding pain for existing users in the hope that the world will be better for new users. Splitting the community on purpose has a cost; just look at python 3 for how painful this is. Whether this makes sense depends very much on the size of your existing user base and on the potential for growth. The users you gain by making a language somewhat more elegant may not be worth the loss from the disruption.
- codeka 12y ago> The cost of the C# approach is that existing classes could not be gradually migrated to be generic; existing collections had to be effectively deprecated and replaced, or a "flag day" had to be declared where all the code (library and client) changes simultaneously. These are not options for us. At the risk of being obnoxious, C# was able to get away with it because at the time, they had a very small base of existing users and code and were not yet successful enough to have to worry about compatibility. The reason C# was able to do it is not because they had so few users that a "flag day" was acceptable, it was because they went with the first option and rewrote all their collections. C# did genetics right the first time, and didn't end up in this bizarre type-erasing, half-ass world that Java find itself in today.