7 ms·
“Java is a big DSL to transform XML into stacktraces” — so was the joke at the time when domain-specific languages were the hype. This, and the FizzBuzz, Enter
by laurent92 6y ago
“Java is a big DSL to transform XML into stacktraces” — so was the joke at the time when domain-specific languages were the hype.
This, and the FizzBuzz, Enterprise Edition: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...
More seriously, what are you missing in Go that is well-done in Java? I assume verbosity of the code is still the defining characteristic of Java?
- matsemann 6y agoThe java ecosystem is very nice. Not necessarily the language itself, but everything else. The jvm, the tools, the libraries are all very mature and good. Skipping java and instead using Kotlin allows one to reuse all that knowledge in a great language as well.
- bcrosby95 6y agoI guess it depends upon what you mean by ecosystem. Java the language is ok. The culture (which is part of the ecosystem) and how you're pushed to write code is the biggest problem with Java. The wide array of tooling, frameworks, and libraries within the ecosystem is nice. But the way you have to use them tends to be shit due to the culture surrounding the language. At least it seems to be shifting to something more sane.
- avmich 6y agoGood language ought to discourage (enough) the bad practices. Culture forms slowly, and it's Java fault that the culture managed to produce such excessities as proverbial FactoryFactoryFactory. Edit: I still think Java is a good language, especially later versions, and both original goals and recent advances are quite noble.
- meddlepal 6y agoI somewhat agree, but Java grew up in a different era when communication about these things wasn't as easy. It's hard to change the direction of something as large and widely deployed as Java. It's happening but it will take time and its always going to dealing with its legacy as there just so much of it out there.
- geodel 6y agoHuh, one needs to see first party Java libraries from earlier times. It is pretty clear engineers at Sun also believed that AbstractFactoryFactory everything will be the way world need to be rebuilt. Of course one can show empathy and understand justifications for things they like and simply laugh out "LOL Go No Generics' when they don't.
- LgWoodenBadger 6y agoI don’t find this to be true outside of the mostly awful, and now dead, JEE landscape. What first-party stuff are you referring to?
- kaba0 6y agoI’m not sure it is necessarily dead, Jakarta EE is alive, but definitely not as big as it was.
- tonyarkles 6y agoNow we've got Spring, which in my, admittedly limited, experience does a great job of transforming what could have been compile-time errors into run-time errors.
- jacques_chester 6y agoThe wheel of karma is ever-turning, though [0],[1]. Disclosure: I work for VMware, which sponsors Spring development. [0] https://spring.io/blog/2021/03/11/announcing-spring-native-beta https://spring.io/blog/2021/03/11/announcing-spring-native-b... [1] https://github.com/spring-projects-experimental/spring-fu https://github.com/spring-projects-experimental/spring-fu
- The_rationalist 6y agoThose are nice advances but I hope that spring will one day support compile time validation of generated queries and of beans like Micronaut do.
- jacques_chester 6y agoI'm confident it'll reach that point.
- noisem4ker 6y ago...and probably well before Micronaut gets rid of its bugs, comes close to feature parity and generally matures as a framework.
- victor106 6y agoSpring native is a game changer for so many organizations using containers for startup times. There are other spring related issues you still have to deal with
- avmich 6y agoWell said :) . Spring looks so much as to show how useful ideas can be misapplied with catastrophic results. For example, liberate encouraging of dependency injections leads to multitude of interfaces which are only ever implemented once by a production code class, and maybe one more time by a test class, even though Java has all methods virtual and testing could be done without requiring the interface.
- voidfunc 6y ago> More seriously, what are you missing in Go that is well-done in Java? 1. Generics. And yea, I know Go is getting generics "Real Soon Now" (tm), but it is incredibly annoying to write the same collection code over and over and there's some third-party libs that would really benefit from generics (looking at you Azure Go SDK). 2. Error handling... with the big caveat that I actually like Go's error handling mechanism at small scale but wish there was a good way to chain several operations together and return an error to the top if any failed... I find myself writing a lot of `err != nil` checks in sequence and I've found baking my own abstractions around this to be leaky or difficult to grow as the program requirements change. 3. Diverse collections API. 4. Iterators. 5. Not Java-the-language but the JVM has amazing monitoring tools. > I assume verbosity of the code is still the defining characteristic of Java? Pound for pound... I think Go and Java have about the same verbosity. I'm honestly never quite sure what people mean by "verbosity" in Java. Generally I interpret this as "frameworks" but I predicated my OP on the idea that legacy framework bloat is where most of people's frustration with Java lies... not the language itself.
- avmich 6y ago> I'm honestly never quite sure what people mean by "verbosity" in Java. Java improved with "var" keyword (use with caution!) and introduction of records. These are not the only code-shortening features (there are e.g. interface methods, diamond operator, lambdas, convenience "of(...)" methods, even "fluid style"), but they, used well, can really reduce verbosity.
- bobthepanda 6y agoAlso, a lot of verbosity in Java came from people going off the rails with design patterns to hide crap multiple levels deep in a file with 5+ words in the class name. If you have a hammer everything’s a nail.
- nitrogen 6y agoFrameworks like Spring/Spring Boot kind of force that as well with their runtime creation of proxy classes.
- pgwhalen 6y agoNot OP, but... > More seriously, what are you missing in Go that is well-done in Java? As cliche as it is to say, Go missing generics (for the time being) does hold it back in many ways relative to Java. I like and use both languages regularly, and as I thought about my answer to this question I realized that essentially all of my complaints stem from the lack of generics - things like streams, a rich collection framework, and non-channel concurrency features (java.util.concurrent among them) don't exist in go because you can build them as generically as needed for them to be useful. You might have said "well-done" as a way of excluding generics in Java since many people like to suggest they're not well done; of course most developers would like more, but they already enable an enormous amount of stuff not possible in Go.
- pron 6y agoI'd say the defining characteristic of Java is an unparalleled combination of performance, observability, and maintainability.
- srparish 6y agoVerbosity of code is more of a go thing these days: hasThing := false for _, v := range stuff { if checkForThing(v) { hasThing = true break } } if !hasThing { return false } Java: if !stuff.stream().anyMatch(v -> checkForThing(v)) { return false; } In the 2020s, loops are the new "goto", too much boiler-plate and ways to subtly be incorrect, much safer to use higher-level collection methods.
- oftenwrong 6y agoreturn stuff.stream().anyMatch(this::checkForThing)
- rafaelvasco 6y agoI at the same time laughed and got nauseated just by looking at that FizzBuzzEnterprise code LOL. I'm a minimalistic programmer myself, so the thing I hate the most in coding is over engineered code. Yes , it's a joke, but a joke based on real life haha.
- mleonhard 6y agoLogging.