4 ms·
OFF-TOPIC: I am the only one who is not that happy that Java is so popular? I don't even know where that feeling come from.
by eDameXxX 10y ago
OFF-TOPIC:
I am the only one who is not that happy that Java is so popular?
I don't even know where that feeling come from.
- pjmlp 10y agoI am happy that Java is popular. I know it since Sun introduced it and it was a saner experience than C++ back in the day, when each compiler implemented their own vision of the ongoing working standard. There are only three things I don't like about Java, proper AOT compilation is only available in commercial JDKs and lack of value types, and use of @Overrides annotation instead of adding a proper keyword. The first two will hopefully get addressed in Java 10, assuming Oracle doesn't change their minds about the language.
- adimitrov 10y agoI agree with your points, but would like to add another one: runtime generic type erasure needs to go. Whether it is through reification or some other means, I don't care, but it feels like every single time I sit down to write some solid core-of-the-program basic code, I run up against erasure. It's probably not every time, but you get the point. That said, I think that Java 8 is in a good state, and I really liked its improvements. For Java 9, the new modularization system seems interesting, and I'll be happy to ditch classpaths!
- pjmlp 10y ago> runtime generic type erasure needs to go. Is is part of the value type related changes. http://www.oracle.com/technetwork/java/javase/community/jlssessions-2016-3114175.html http://www.oracle.com/technetwork/java/javase/community/jlss... How it will actually look like is still WIP.
- aardvark179 10y agoI think you should be very careful with statements like that. The Valhalla work adds a mechanism by which generic types can be reified, but reference types in Java are not proposed to be reified as that would cause big interoperability problems with existing code. However the mechanism introduced for reifying value generics could be used by other JVM languages to provide reified reference generic types. So HashMap<MyRefClass> will always remain the same class as HashMap<Object> when created in Java code, but might not be the same in another JVM language, and HashMap<MyValueType> will never be the same class as HashMap<Object>.
- pjmlp 10y agoTrue, but nothing prevents them to have an ImprovedHashMap<any MyRefClass>.
- jburwell 10y agoI couldn't agree more with you. Erasure was one of the top boneheaded decisions made in the history of Java development. The irony was that it was done in the name of backwards compatibility that, in practice, was unnecessary. The runtime and API changes introduced Java5 we so large that byte-compatibility was no useful during the transition.
- merb 10y agoSo true about value types. However this will flip flop the whole memory experience in JDK9. I mean even if a LocalDateTime could be represented as a Value Type would be a significant amount of memory saving on our backend. And there is other stuff which adds a unnecessary amount, too. I mean we still get a lot of Long / Int boxes. Hopefully Java 10 will reduce that. We are on Scala and I guess Valhalla will also make Scala even more awesome with Value Types. I could consider that half of the case classes could be real Value Types.
- pjmlp 10y agoAnother one would be having Optional finally being a value type and do away with the whole issue of Optional being null when APIs play dirty.
- jfoutz 10y agoit's humbling. With a small community, if you have an idea, you can create a pull request and change the shape of the ecosystem. It's not that hard to create the definitive library, with a few weeks or months of effort. In a medium community, you can shape discussion. It's still possible to have a lot of influence without tons of effort. In a large community, you're up against really smart people who are paid to solve problems that can take weeks to simply understand. You could hack up golang library for web handling that's somewhat novel and get traction. Java? Tomcat has tens of thousands (perhaps hundreds of thousands) of professional hours thrown at it.
- ivan_gammel 10y agoI'm happy, because Java already solved a lot of problems on which many emerging platforms are still working on. It's mature, it's working, there's great community and mostly a consensus on architectural approaches. It could be better, but the features I personally desire (better reflection and metamodels to support generative programming), are not present nowhere in other popular languages and platforms.
- djhworld 10y agoJava is a reliable tool. Might not be hip or shiny, but it works. Always good to have in your toolbox in my opinion.
- aikah 10y agoJava 8 is fine. It fixed a lot of Java's issues, and introduced some functional programming concepts which might help reduce the usual boilerplate.
- galdosdi 10y agoIt probably comes from an earlier experience with a crappier Java. But Java 2, Java 5, and most of all Java 8 (and IMHO, a gradual attitude change from J2EE-style architecture astronautism to Guava-style DRYism) have transformed it into a very pleasant language to use, on a very mature, reliable platform, that also connects to other interesting languages like Scala. I don't know any other popular (popularity matters! a large ecosystem is very useful) language that is as well suited for making very maintainable, low defect codebases. (Although, I'm working on learning golang.) Java's now-undeserved reputation is just a historical legacy now, but it serves a useful purpose: keeping people like you, who might compete, from using the best tools available. Strangely, I think Java can, at least for a while, count as a "secret weapon" the way Paul Graham described lisp once. (Or is the cat too far out of the bag already? Given how much software is still being unnecessarily written in languages like Python, Ruby, JavaScript that lack type verification, I think Java is still a secret weapon for now)
- jahewson 10y agoI would describe Java as verbose, inflexible, and outdated. While it's possible to write maintainable code, it's a real uphill battle. Core libraries such as Java2D are also pretty buggy... after all these years. Give me C# any day, or better yet, F#.
- plandis 10y agoAnd how much time have you actually spent writing Java code?
- galdosdi 10y agoIt's true (so I hear) that C# has been ahead of Java on this for a while, but I think the JVM is ahead of the CLR in terms of ecosystem. If you like F#, maybe try Scala on the JVM. Did you use Java 8 last time you worked with Java? And ideally, maybe something like lombok or scala case classes or protobufs to make value object classes easy to declare? Also, don't use Java2D then. There's better libraries for that. Maybe it's technically considered a core library, but I wouldn't consider it important