News for hackers. Stuff that matters.
Re:Java in the Small by MattPalmer1086 on Wednesday December 18, 2024 @04:45PM (#42455714)
Ahhhhh, yes. Java itself isn't bad and has been getting better. The frameworks made me want to scream.
Re:Java in the Small by arez on Wednesday December 18, 2024 @05:13PM (#42456040)
which ones specifically? I like Spring Boot tbh
Re:Java in the Small by MattPalmer1086 on Wednesday December 18, 2024 @05:37PM (#42456246)
Hibernate mostly. Spring too, but it has been a while. Mostly I just find the abstraction isn't worth it .
Re:Java in the Small by Terr_ on Wednesday December 18, 2024 @07:32PM (#42457074)
I find pretty much every ORM in any language is problematic. The best you can hope for is a certain amount of internal design consistency, so that even if you can't do what you want it's at least clear what you are doing.
Re:Java in the Small by Alupis on Wednesday December 18, 2024 @06:12PM (#42456541)
The way you write this makes be think you rawdog'd Hibernate and Spring Framework. Don't do that... you will hate yourself.

Boot is something entirely different. You write very little code and get a ton done. The trade off is you are firmly now a "Boot" codebase, but once you learn how Boot works it's not a big deal.

Re:Java in the Small by fiddlerwoaroof on Wednesday December 18, 2024 @11:42PM (#42458485)
I've had to maintain a couple Spring Boot apps and I absolutely cannot stand them: they pull in a whole pile of random dependencies and do weird things to your build with little explanation. Then, all the functionality involves a ton of classpath scanning and annotation-based DI that makes it hard to figure out how all the things fit together.
Re:Java in the Small by gf000 on Thursday December 19, 2024 @03:23AM (#42459507)
I mean, have you learnt the framework before attempting to do that?

Frameworks are frameworks, not libraries. You can't just start writing/understanding them - frameworks are different from libraries precisely because they call your code, not the reverse.

Re:Java in the Small by lproven on Thursday December 19, 2024 @06:24AM (#42460426)
That's a great explanation. Thanks for that.
Re:Java in the Small by fiddlerwoaroof on Thursday December 19, 2024 @04:33PM (#42465902)
Yes, the problem is exactly that the framework calls your code instead of being called by you code.
Re:Java in the Small by Alupis on Thursday December 19, 2024 @04:40PM (#42465965)
That's how all frameworks work though. This is not a criticism of Spring Boot. You are criticizing the use of a framework at all.

Some people hate to write the same basic things over and over. That's where a framework excels. Write only the glue/logic you need to make your app work.

The way you have described your experience with Spring Boot seems to imply you did not take the time to learn it at all, and therefore its' unsurprising to us you had a hard time of it.

Re:Java in the Small by fiddlerwoaroof on Thursday December 19, 2024 @07:09PM (#42467093)
Not writing the same thing over and over again is a feature of abstraction. A framework is a user-hostile way to abstract because it makes the source code opaque to developers. There's no reason why a library-based approach has to be more repetitive than frameworks.
Re:Java in the Small by gf000 on Friday December 20, 2024 @05:53AM (#42470016)
CRUD backends have well-understood requirements, in a way, a significant part of the work is done for you. You are there to customize certain parts only.

How else would you architect with this in mind? Given that literally every other framework is quite similar (RoR, PHP's solutions, etc).

There is another niche, the HTTP server libraries, but they are much more low level.

Re:Java in the Small by Alupis on Friday December 20, 2024 @01:49PM (#42473695)
Right, so you cobble together 48 different libraries, wrangle all of their configurations and stitch them all together yourself.

You do this 18 times because you have 18 different apps with similar requirements but deal with different data/endpoints/whatever.

On your 19th app you decide to standardize how you cobble together all of these libraries so that you don't have to start at ground zero every single time.

Now you've invented a framework.

Re:Java in the Small by MattPalmer1086 on Thursday December 19, 2024 @11:52AM (#42463300)
I was working with legacy code bases where the original Devs loved frameworks. Massive performance problems and nobody could understand how it all fit together at runtime.

Hibernate eventually got entirely nuked, Spring we couldn't entirely unwind easily; it had caused a whole bunch of crappy architectural issues and was too much effort to rewrite from scratch.

Although the code looked simpler using the frameworks and annotations, it was actually a huge rotten mess that didn't work well at all, with workarounds for all kinds of weird things in it.

Re:Java in the Small by cryptos on Thursday December 19, 2024 @04:39AM (#42459914)
Since I had the "joy" to use TypeORM (node.js stuff), I really value Hibernate, although there are some little corner cases I'd like to be better. But ORMs solve a really hard problem and I haven't seen anything better than Hibernate so far (and don't come up with JOOQ or MyBatis!).