Live data from Hacker News

The Modern Java Platform – 2021 Edition

jamesward.com

151–160 of 259 posts

Re: The Modern Java Platform – 2021 Edition

#151
post #21

There's some great stuff on the JVM today, but Spring Boot is recapitulating all the problems of J2EE. Everything is extremely "decoupled" to the point that you have no idea where anything comes from or why, and just adding a new dependency to your classpath will radically change the behaviour of your application (oh, you added a dependency on a library that has a transitive dependency on the MongoDB client? Guess th…

> Everything is extremely "decoupled" to the point that you have no idea where anything comes from or why, and just adding a new dependency to your classpath will radically change the behaviour of your application

What does "decoupled" even mean anymore? That sounds like the opposite of "decoupled" to me.

(/not a Java programmer).

Re: The Modern Java Platform – 2021 Edition

#152
post #114
post #21

There's some great stuff on the JVM today, but Spring Boot is recapitulating all the problems of J2EE. Everything is extremely "decoupled" to the point that you have no idea where anything comes from or why, and just adding a new dependency to your classpath will radically change the behaviour of your application (oh, you added a dependency on a library that has a transitive dependency on the MongoDB client? Guess th…

I simply don't understand how people favor a stringly typed custom DSL in a reasonably typed language like java. Why is it better to write Spring annotations instead of actual java code? There is literally no upside.

One possibility is that the code is just Java and the end of the day. You could run it independent of Spring processing the annotations.

Re: The Modern Java Platform – 2021 Edition

#153
post #136

People are critical of Spring because they have seen it in production and in practical projects. And fall in the naive trap that somehow the tools and the libraries are the reasons why a real-life software project is messy. However Spring is something that has stood the test of time and is used in thousands of actual projects. And Spring itself emerge out of practical software development with plenty of competing alt…

I'm not critical of spring because real life software projects are messy. I'm critical because I rarely if ever do greenfield development and when I'm debugging a production exception caused by something that Java's type system was perfectly capable of treating as a compile time error that is suddenly a runtime error I'm a little bit sad. And the sheer frequency that I encounter them indicates that just getting more…

The number of time's I've seen an error that amounts to `this instance of Foo should have been a FooBar, not a FooBatz` is really depressing.

Re: The Modern Java Platform – 2021 Edition

#154

Earlier quoted context omitted.

Totally agree, why i use https://www.dropwizard.io/en/latest/ with guice, generally waaayyy more explicit about whats going on

Also very lightweight and pleasant to use are Javalin and SparkJava. I've used them for all kinds of projects with great results. Basically a Java version of Python's Flask - small and concise but stable and performant enough for many (or even most) web projects. https://javalin.io/ http://sparkjava.com/

Our team has had a lot of success with both of these too. The single architectural choice I completely disagree with though is their use of Static methods to hook things together.

Re: The Modern Java Platform – 2021 Edition

#155
> I really enjoy writing Scala code and the continual improvements. It feels very cutting edge and my personal productivity feels significantly better than with more archaic languages like Go.

Google seems really hiring clueless marketers lately. This article is indeed full of hilarious nuggets like above.

Re: The Modern Java Platform – 2021 Edition

#156
post #7

My biggest gripe with java is developer productivity. It has gotten better but is still far behind interpreted languages like Python and Ruby. Class hot loading and things like that have made it better, but if you change a method signature or interface you have to stop your process, recompile, redeploy, and restart. For big codebases it’s brutal compared to the aforementioned languages and their attendant frameworks.

That's interesting. I'm not the biggest Java fan, I can tolerate it. Recently working on a Python project I find I'm massively unproductive compared to something like Java or more specifically Scala as using Spark. Not having strong types and limited type hinting. I have no idea what things are, is it a int, string, object etc, clicking through in an IDE to see code/docs isn't as great as it's hard for an IDE to insp…

> I have no idea what things are, is it a int, string, object etc,

What if it's some kind of a String? Only a String starting with "_". You may define UnderscoreString. But now it's not obvious what this is. You have to go look it up either way. A compiler may stop you from passing a regular String. If you're very lucky it may even stop you from casting an obviously wrong literal. But beyond that you're probably out of luck unless it's a crazy language. Once everything is a custom type how is remembering all the types different from remembering what each function does?

I'm not sure how unit tests help here much either. Why would you come up with an example that breaks your code in a unit test but couldn't think of it beforehand? Unit tests are used just as much in environments with a helpful compiler. They mostly help stop new breakage affecting stuff that used to work.

I wouldn't write off checking at runtime. You can actually define exactly what it is and it's easier. You can do as little or as much of it as you want. It's not compile time but depending on your software you may be able to get fast feedback. This level of checking would not be compile time either way. If you really want to be sure you'll be doing this in your typed language too. You're only worse off if you'd really benefit from the simple stuff.

If wrong data hitting a function can cause multi-million dollar loses would a single person think the compiler is good enough? What if it can cause major data loss? Big embarrassment? Pretty clear to me one will only trust the compiler with bugs that don't matter in the first place.

Re: The Modern Java Platform – 2021 Edition

#157
post #21

There's some great stuff on the JVM today, but Spring Boot is recapitulating all the problems of J2EE. Everything is extremely "decoupled" to the point that you have no idea where anything comes from or why, and just adding a new dependency to your classpath will radically change the behaviour of your application (oh, you added a dependency on a library that has a transitive dependency on the MongoDB client? Guess th…

As someone who loves Python/Django, dabbled in Ruby/Rails, learned a multitude of front-end JS frameworks (Backbone, React, AngularJS, and Ember), and currently works with Java in an enterprise environment, I just want to add two points: - If you're going to have config/setup files, make sure they utilize a language that is Turing Complete. YAML looks pretty, but for all practical purposes, is it really better than X…

XML is not any more or less "turing complete" than yaml, is it? They both express static data structures. I suppose you can make turing complete languages that use the syntax of either one (XSLT is one; i'm sure there are others in YAML), although it gets pretty iffy.

Re: The Modern Java Platform – 2021 Edition

#158
post #137

Earlier quoted context omitted.

This right here, print statement debugging gets far more of a bad name than it deserves. If that's a developers only tool then sure that's a problem, but no need to hate on a very simple and effective technique just because it's often the only one people know when they are starting out.

Print debugging results in a printed log of this happened, then this happened, ..., and finally this happened. And you can trivially rewind it and do random looks at the log. Debuggers have difficulty giving you this much context at your fingertips. The downside is that if you missed one of those critical "this happened" items in your log you have to rerun. But debuggers have the same problem. If you missed a breakpo…

Intellij’s debugger has a ‘drop frame’ feature that i use a lot for going back in time when i missed something.

It also shows you the state of variables at various points alongside the code, which is basically the context i want to log anyways.

Re: The Modern Java Platform – 2021 Edition

#159
post #17
post #7

My biggest gripe with java is developer productivity. It has gotten better but is still far behind interpreted languages like Python and Ruby. Class hot loading and things like that have made it better, but if you change a method signature or interface you have to stop your process, recompile, redeploy, and restart. For big codebases it’s brutal compared to the aforementioned languages and their attendant frameworks.

Well..there are always commercial tools like JRebel ( https://www.jrebel.com/products/jrebel ) that one can leverage for live reload

Jrebel is really really good but it’s just way too expensive. Maybe worth it for some folks though.

http://hotswapagent.org/ Is an open source alternative and covers about 90% of what jrebel does

Re: The Modern Java Platform – 2021 Edition

#160
post #21

There's some great stuff on the JVM today, but Spring Boot is recapitulating all the problems of J2EE. Everything is extremely "decoupled" to the point that you have no idea where anything comes from or why, and just adding a new dependency to your classpath will radically change the behaviour of your application (oh, you added a dependency on a library that has a transitive dependency on the MongoDB client? Guess th…

> Everything is extremely "decoupled" to the point that you have no idea where anything comes from or why, and just adding a new dependency to your classpath will radically change the behaviour of your application What does "decoupled" even mean anymore? That sounds like the opposite of "decoupled" to me. (/not a Java programmer).

Everything is wired up using Dependency Injection. So you just state your claims and are given appropriate objects that may be created by some third party factory factory. It's really neat until it isnt.
Post reply on HN