4 ms·
Java is anything but simple, all the major framework are heavy duty things behind layers of magic abstraction and un-necessary complexity. Did you worked with S
by Thaxll 5y ago
Java is anything but simple, all the major framework are heavy duty things behind layers of magic abstraction and un-necessary complexity. Did you worked with Spring, Hibernate
/ random ORM and all the "enterprise" frameworks?
- bognition 5y agoYeah, Java can be bad, but thats more the old school enterprise frameworks. A lot of newer things in Java are much simpler and easier to use. You can be very successful building out your own framework using things like Guice, Guava, and Dropwizard. It lets you pull in what you want and leave out the things you don't need.
- vips7L 5y agoHelidon, Quarkus, Javalin etc. There's plenty of options if you want to build your framework yourself.
- deleted 5y ago[deleted]
- ohgodplsno 5y agoSo, the libraries that some developers have to use are complex. Not the language itself. Additionally, Spring Boot exists and is lightweight and super easy to understand, jooQ is an ORM/query builder that makes Hibernate look like a toy (and it super simple). Just because Java gets tainted by overengineering doesn't mean the language itself isn't simple.
- Thaxll 5y agoBut in Java you have to use frameworks since the std lib does not offer anything for web / DB. Does not matter if the language is simple but you're forced to used a framework.
- gmfawcett 5y agoServlet API and JDBC are as standardized as you can get. If you want more than that, in any language, you're reaching for a framework.
- heurisko 5y agoJava has JDBC and HttpServer for a rudimentary server.
- qsort 5y agoThere are plenty of alternatives to ORMs. We use JDBI (https://jdbi.org https://jdbi.org) which is dead simple and a happy medium between pure JDBC and a full blown ORM. Even using the built-in JDBC support is an option with modern Java, PreparedStatement and ResultSet implement AutoClosable, which means you can write code like this: try ( final var rs = conn.prepareStatement(""" <SQL here> """).executeQuery(); ) { while (rs.next()) { // do your thing } } catch (SQLException e) { // your code here } Which is just the standard library and no more verbose than most other frameworks. As for web frameworks, there's a million of them. Pick a non-magical one if you don't like magic.
- heurisko 5y agoI had to learn Spring and Hibernate. Spring had good documentation that you can read on an ereader. It's also very mature, so there's lots of help on Stackoverflow. Hibernate was a bit more difficult, but Vlad Mihalcea has improved the documentation side a lot. Hibernate also allows you to drop down to native queries, which coupled with Spring Data's "projections" are useful.
- deleted 5y ago[deleted]
- kaba0 5y agoDo you think that the alternative of not caring about transactions, using ad hoc ORMs, home-made DI-like contraptions would be beneficial for a typical CRUD app? And I know it is a logically fallacious argument on my side, but I think we tend to understate the huge amount of repetitive task that you will definitely need, but think it is not yet important. Also, I think it is overblown how magical those annotations/code generation are. It is simply class path scanning and code generation under the hood, so that a proxy object is used instead of the interface. I would take this path any number of times instead of what abomination n developer hacked up over the years with no proper abstraction and documentation.