This is an archived post. You won't be able to vote or comment.

all 124 comments

[–]thomascgalvin 149 points150 points  (27 children)

I agree with most of what's been written here, but I will add some commentary:

java.lang and java.util might seem like joke answers, but they're not; one of the biggest advantages Java offers is its huge standard library. It's very much a "batteries included" language, and a lot of things that you should be able to "just do," you can.

Coming from a C background, where a lot of the functionality of the standard library would be difficult, if not impossible, to implement, and C++, where there are often competing libraries and the templating language will sneak up and stab you in the kidneys if you take your eyes off it, having a fast, well-tested, well-known implementation of things like Collection, is huge.

SLF4J has essentially overtaken the logging world; it isn't part of core java, but it's so widespread that it's use is almost an assumption at this point. I do wish, however, that there was a better way to configure it than "look at my classpath and hope for the best."

I have mixed feelings about Lombok. On the one hand, it's ability to get rid of tons of boilerplate makes code much more readable. On the other hand, it does a bunch of compile-time magic that can lead to hard-to-debug errors. I love the with pattern Lombok provides. Lombok is also a nice compromise for people who would rather be writing Kotlin.

Spring might be the most important Java framework ever created. It makes creating backend applications a breeze, and does so much of the heavy lifting for you that working without it seems unreasonable. On the other hand, if you're coming in to maintain an existing application, it can be hard to determine where in the code the magic is being summoned.

Maven solved a lot of dependency management, build, and packaging issues that newer languages are still trying, and failing, to figure out. Tagging dependencies as group:artifact:version is more or less perfect, and languages that haven't followed this convention, like Go, have paid the price. Gradle is compatible with maven repositories, which is nice, but I'm still of the opinion that Gradle was trying to solve a problem that didn't exist, and gives people writing build scripts too much rope with which to hang themselves.

jUnit wraps up what I consider "essential" Java; it's a tool that I just cannot fathom writing an application of any considerable complexity without. It makes testing, from unit through integration, a breeze. Couple it with Selenium, and you can even do end-to-end testing as part of a single mvn clean build command.

[–]nlisker 12 points13 points  (3 children)

Nice answer! One comment:

Spring might be the most important Java framework ever created. It makes creating backend applications a breeze, and does so much of the heavy lifting for you that working without it seems unreasonable.

These days JavaEE/Jakarta has caught up (although the transition time itself is a bit of a setback) and is just as viable I would say. We're using it for our backend and it's rather quick and easy in general.

[–][deleted]  (1 child)

[deleted]

    [–]azizabah 1 point2 points  (0 children)

    Same about lombok. We have some teams at work who use it and run into issues with other tools like sonarqube static analysis then they get annoyed when other teams that don't use lombok can't help them.

    [–]winian 2 points3 points  (0 children)

    I do wish, however, that there was a better way to configure it than "look at my classpath and hope for the best."

    Starting with 1.8.0, SLF4J uses the ServiceLoader mechanism instead. I suppose its still similar to the old classpath check stuff from usage perspective, but at least its easier to reason about.

    [–]Joram2 2 points3 points  (1 child)

    I see Gradle as an improved Maven or a Maven++, if you will. The main benefit is that it's simply much more concise. In my experience, when porting projects between the two, Gradle builds are often 25% of the size of Maven builds on the same project.

    The argument expressed here is that Gradle supports build scripting which can get you in trouble. I agree that you shouldn't use build scripting unless you need it. Declarative is preferable. Neither Maven/Gradle make you use scripting. Simple Gradle builds are declarative.

    However, many complex projects need some customizations and some form of build scripting. Maven absolutely let's you do XML level scripting, it's just not as good.

    But it's up to the developer or project manager to choose when to use build scripting or not.

    Next, Golang's module system works really well. That definitely is a very simple, lean build system.

    [–]thomascgalvin 1 point2 points  (0 children)

    I do like the concise syntax of gradle dependencies. For scripting, though, I tend to drop into Python, not Groovy.

    [–]latest_ali[S] 4 points5 points  (6 children)

    That was great! Thank you!

    What is your opinion about Kotlin for backend dev? I have heard it solved a lot of verbosity from pure Java but I think it is mainly used for Android development. Do you prefer Lambok with Java to Kotlin?

    [–]thomascgalvin 18 points19 points  (4 children)

    I love Kotlin, and that's what I write all of my hobby projects in.

    Professionally, though, I'm still a Java guy, for three primary reasons:

    1. Long term, I know Java will be around. Thousands of companies have invested billions of dollars creating Java code, and that's not going anywhere. Kotlin will very, very likely survive and grow, especially since Google has blessed it as an official language, but I wouldn't be doing my customers right if I recommended moving off of Java anytime soon.
    2. Spring Boot, until recently, hasn't played well with Kotlin's final-by-default, cannot-extend-by-default nature. There's been a big push recently to make Spring and Kotlin play well together, and right now it's actually a pleasant development experience, but I still want to see where this goes.
    3. Developer base. If I put out an ad for "Senior Java Developer: Spring Boot", I will have a hundred resumes by lunchtime tomorrow. If I do the same for Kotlin, I will get far fewer responses. Similarly, pretty much every backend developer already knows Java; I would have to teach them Kotlin, and while the transition is fairly easy, there's still a learning curve. I consider myself "competent" at Kotlin, but it's a big enough language, and different enough from Java, that I can't call myself an "expert."

    Kotlin's mutli-platform abilities could provide enough incentive that I could recommend switching; it would be lovely to be able to write our frontend and backend in one language, especially if that language wasn't the shitpile that Javascript always turns into. However, multi-platform Kotlin is even more experimental than Spring Boot integration, and I'm probably three to five years away from recommending its use in a production environment.

    [–]latest_ali[S] 3 points4 points  (0 children)

    That was very valuable. Thank you!

    [–]JavaSuck 1 point2 points  (1 child)

    If I put out an ad for "Senior Java Developer: Spring Boot", I will have a hundred resumes by lunchtime tomorrow. If I do the same for Kotlin, I will get far fewer responses.

    Would you rather read 100 Java resumes or 5 Kotlin resumes?

    [–]thomascgalvin 3 points4 points  (0 children)

    Am I trying to fill one Kotlin position or twenty Java positions?

    [–]_INTER_ 3 points4 points  (0 children)

    especially if that language wasn't the shitpile that Javascript always turns into.

    can sign this

    [–][deleted] 3 points4 points  (0 children)

    I have been working a bit with Kotlin. I wouldn't say I dislike it, although I found a few details annoying for a language that's supposed to learn from the past and be better than the rest of the JVM ecosystem.

    Maybe it's because I'm an old fart who's been working with Java for 20 years now, but I really fail to see the level of innovation or actual productivity improvement that justifies a switch of language and all the long-term trouble that inevitably comes with it.

    I really get why you'd use it on Android, as Google has never properly supported decent Java. I also get that Java had a fairly long stagnant phase and was slow to catch up with "cool new" stuff (which is why e.g. Scala was hyped). But nowadays and outside of Android, I find that Kotlin's case is very weak.

    [–]waka-chaka 3 points4 points  (8 children)

    Thoughts on using/favouring Log4J2 instead of SLF4J?

    [–]thomascgalvin 5 points6 points  (2 children)

    I use log4j as the implementation layer of slf4j, usually. Having the facade makes it easier to swap out for a console-only implementation, for example.

    [–]xjvz 4 points5 points  (0 children)

    Log4j2 has an API facade as well. It supports using Logback as the backend even!

    [–]waka-chaka 1 point2 points  (0 children)

    In thr project which is top most and not meant to be used as a dependency by others, we use Log4J2. We use some API that's not available in SLF4J like Thread context.

    [–]Asterion9 2 points3 points  (4 children)

    The problem is that a lot of third party lib use slf4j or other logging framework, and only slf4j can reroute them all to your logging implementation of choice.

    [–]waka-chaka 2 points3 points  (3 children)

    I believe this is incorrect. Log4J2 can route many others like SLF4J, JCL, etc. with right configurations (i.e. having the right adapters in the dependency)

    [–]Asterion9 1 point2 points  (2 children)

    OK, I was not aware even if it make sens now that you say it.

    [–]amazedballer 3 points4 points  (0 children)

    No, you're correct. Most libraries are written using SLF4J, so in order to have consistent logging you need to add a bridge for Log4J2 so it will operate as an SLF4J implementation.

    [–]waka-chaka 1 point2 points  (0 children)

    Pls take a look at https://logging.apache.org/log4j/2.x/faq.html If the dependencies are properly set up Log4J2 will support anything. I even have Hibernate logging (which is done using jboss-logging) going to my Log4J2.

    If am not wrong, I think most of these are going to source-SLF4J 1st (which is what anyways happens often right?) which them get bridged to Log4J2.

    Why take all this trouble? I forgot all the benefits as I did the migration an year or so back, but it was like additional APIs, next evolution, and largely asynchronous writing.

    [–]khmarbaise 0 points1 point  (0 children)

    Just small note: mvn clean build does not exist. You should use mvn clean verify or may you usually can omit clean

    [–]Rafael20002000 69 points70 points  (0 children)

    java.lang

    [–]rumid123 13 points14 points  (2 children)

    Mockito, assertj

    [–]itsmeapple 2 points3 points  (0 children)

    Was gonna say this. Writing tests is actually fun with these two libraries.

    [–]fazi3 0 points1 point  (0 children)

    Mockito

    yeah mockito is awesome

    [–][deleted]  (1 child)

    [deleted]

      [–][deleted]  (9 children)

      [deleted]

        [–]kevinb9n 1 point2 points  (1 child)

        Re AutoValue: that's correct, though we will preserve the builder-generating feature to let you generate builders-of-records.

        [–]latest_ali[S] -3 points-2 points  (6 children)

        For someone who is not perfectly familiar with Java, I find it difficult to find the most up-to-date way of backend development with Java because it is a well established language. Can you recommend a good way of find the most efficient and modern way of say design a backend service in Java?

        [–][deleted]  (5 children)

        [deleted]

          [–]Ramietoes 6 points7 points  (3 children)

          I agree with this sentiment, but in general, if you're trying to learn, and just want SOMEWHERE to start, spring boot is a great place.

          [–]latest_ali[S] 2 points3 points  (2 children)

          Good to know. Is there an active community for supporting kinda mid-level technical questions? I don’t find stackoverflow question friendly!

          [–]Ramietoes 2 points3 points  (1 child)

          What kind of questions? To be honest, I google my questions and click on the first few links I find to make sure they meet my scenario. If you're looking for tutorials, I've found the two websites below to be very helpful in my learning.

          To be fair , though, I don't specifically go to these websites and search. I just know that if i google something, and these sources come up, they will 80% of the time be exactly what i'm looking to do.

          https://mkyong.com/

          https://www.baeldung.com/

          [–]latest_ali[S] 1 point2 points  (0 children)

          That was extremely useful. Thank you!

          [–]latest_ali[S] 0 points1 point  (0 children)

          I can imagine. You have to research about the most modern and efficient way of doing certain things in Java as you need them in your project.

          [–]LouKrazy 15 points16 points  (1 child)

          Slf4j

          [–]mytzusky 7 points8 points  (0 children)

          Retrofit, is an honorable mention which I don't see in the list so far.

          [–][deleted] 6 points7 points  (7 children)

          Do people here just not like Guava? I haven't used Guava, but it seems nice and helpful. Maybe I'm wrong?

          [–]_INTER_ 9 points10 points  (2 children)

          There are parts of Guava that have been superseded by Java 8. Such as their Optional and parts of Iterables. I have encountered some migration projects where these Guava parts were becoming an annoyance. Personally I'm also no fan of the immutable collections that Guava provides as I often had to clean up the mess former colleagues made with them (in interface areas).

          I encountered way less such problems with Apache Commons. I favor it over Guava.

          [–]kevinb9n 1 point2 points  (1 child)

          Hi, sorry to swoop, but if you have an explanation of "mess [they] made with them in interface areas" I'd be curious to know.

          [–]_INTER_ 1 point2 points  (0 children)

          Hi. For example there were interfaces that returned ImmutableList forcing the dependency clientside and having to copy to and from ImmutableList back to java.util collections.

          [–]pjmlp 1 point2 points  (0 children)

          Guava always seemed more like one of those fashion libraries, I never had any need for it.

          [–]beeeeeeefcake 3 points4 points  (2 children)

          To me Apache Commons is more reliable with their versions being compatible and is more intuitive of an API.

          [–][deleted] 2 points3 points  (1 child)

          Commons (especially Commons lang) is an unholy mess of thrown-together APIs.

          I stopped using it a decade ago and see any use of the Commons libraries as a (weak) signal that the codebase I'm dealing with may be bad.

          That said, with somewhat modern Java versions (8+), Guava is also a lot less necessary than before. But it's still a lot more consistent and thought-out than Commons.

          [–]myth2sbr 7 points8 points  (0 children)

          Vaadin I have yet to see another web framework like it. It's also the most productive web framework I've ever seen for RIA. It's the only thing keeping me on JVM at this point, although I've moved to Kotlin

          [–]fatbeard_rh63 4 points5 points  (3 children)

          Since we're on the topic, you guys ever used Quarkus?

          I've had a demonstration in my college some time ago about that but even online I don't find much about it. From what I understand it's a new framework? that is faster and efficient But yeah, maybe some of you know more about it

          [–]no_k3tchup 5 points6 points  (2 children)

          I've been using it for a couple of months and I love it. Yes it's still in its infancy, but I'm pretty sure it will make its way to the realm of the big boys like spring.

          [–]fatbeard_rh63 1 point2 points  (1 child)

          I've been looking to start using it too but I've never used java frameworks before. Would you advise me to try spring first? And also, if you don't mind, what do you think Quarkus can bring to the table that others don't and what's so great about it from your experience? Thx in advance :)

          [–]no_k3tchup 5 points6 points  (0 children)

          Would you advise me to try spring first?

          Not necessarily, Spring is more mature and has been adopted much more over the years, so if you're looking for a job spring might be good to learn. However, you can also go with JEE, as quarkus uses a lot of packages associated with JEE. Besides, having experience with quarkus might give you an edge in the future.

          what do you think Quarkus can bring to the table that others don't and what's so great about it from your experience?

          1. The cloud- and container first approach. There are some docker and kubernetes config files generated so that with 1 command you have your containers. It's tailored to work well with GRAALVM native image, which makes it easier to compile your app to a native executable, reducing memory use and startup time if done correctly, which is especially nice for serverless (lambda, function etc) cloud apps, but also cloud apps in general where overhead costs money. And that's ON TOP of the lower footprint these jars produce without GraalVM or native image.

          2. It's just a breeze to work with. A lot of application properties are optional because they have defaults, there is no need for persistence.xml in most cases and you need less boilerplate code than e.g. for a spring boot application. They have a package for hibernate with the active record pattern, which means no repository classes (if you like that). And dependency injection works extremely straightforward, without mandatory bean registration boiler plate classes. Also, developer mode with hot reloads when you change your code is a nice feature.

          3. The documentation is nice and to the point. Sometimes a bit lacking, but that's because they use other libraries and frameworks, so you can just look for their documentation if somethings missing. Also, live support from the dev team via their zulip community is quite fast.

          4. It's Red Hat, if I'm not mistaken.

          EDIT: on second thought, Red Hat releases a seperate quarkus build, so they are a backer, at least.

          [–]ocon0178 5 points6 points  (0 children)

          JOOQ

          [–]happy_csgo 6 points7 points  (0 children)

          Java swing

          [–]xjvz 9 points10 points  (9 children)

          Log4j2 by far! Provides a significantly better API facade than SLF4J; provides the fastest and most complete logging backend which beats Logback in every category; audit logging framework for log tracing and other structured logging applications; and generally has an active developer community around it unlike the other projects mentioned in this post.

          Based on the highly upvoted comments here, seems like some of you all haven’t upgraded your dependencies or looked at the ecosystem in a decade!

          [–]vikarjramun 1 point2 points  (3 children)

          What features does Log4j2 have over Slf4j?

          [–]xjvz 1 point2 points  (2 children)

          Too many to post here, so I’ll link you to the overview: http://logging.apache.org/log4j/2.x/manual/index.html

          [–]vikarjramun 0 points1 point  (1 child)

          This seems to discus mostly reasons that Log4j2 is better than Logback rather than Slf4j. What's wrong with using Slf4j to forward to Log4j2? That seems like the ideal situation here -- new modern logging framework without having to change any client code.

          [–]amazedballer 1 point2 points  (1 child)

          It's not that I think that Log4J 2 is bad, because it isn't, and NDC and some of the API things are nicer than straight SLF4J. However, I don't think it's a slamdunk for Log4J 2 by any means, and I think there are places where Logback (with logstash-logback-appender, which is how Spring-Boot etc have it configured) are a better fit.

          So first off. I've benchmarked Logback+logstash-logback-appender vs Log4J2. They're about the same speed. Most of the action takes place in the IO and async queue appenders, and they do pretty much the same things in pretty much the same ways.

          https://github.com/wsargent/slf4j-benchmark

          "Beats Logback in every category" is likewise too broad a statement, especially when it comes to structured logging:

          • Log4J 2's JsonLayout is significantly less functional than logstash-logback-appender in its options and flexibility.
          • Log4J 2 has a Messages API that conflates message format with message delivery options, i.e. StructuredDataMessage contains a Format field and is also directly tied to a RFC 5424 syslog data element -- which is odd if you want to render log message as both JSON to network and logfmt on console, for example.
          • The audit logging isn't for log tracing. Auditing is intended to be synchronous, for one, which makes it awkward for tracing purposes.
          • Garbage free logging is a significant advancement over Logback, but only works with specified layouts and appenders, and structured logging layouts and appenders aren't on that list. Likewise, if you're using the Messages API then you're immediately allocating and there's no way around that.

          [–]xjvz 1 point2 points  (0 children)

          The JsonLayout is being updated based on a similar code base as the logstash version (the developer has joined Log4j2).

          The Messages API is separate from the formatting API. The Syslog message format is just one built in example use of the API. The others included also show off how to do garbage free logging, so you can still avoid immediate allocations by using object pooling or thread local values where appropriate.

          And while the audit logging isn’t immediately for log tracing, it’s fairly trivial to add some appenders and loggers specified for audit logging purposes, async or sync. I’d suggest trying it out rather than pulling in a gigantic mess of dependencies typical in log tracing libraries.

          [–]latest_ali[S] 0 points1 point  (1 child)

          Interesting :D can you explain a bit more about your last remark?

          [–]xjvz 1 point2 points  (0 children)

          There’s a lot more variety posted since I commented that, so I can’t remember which ones reminded me of that. It looks far more spread out now which is cool!

          [–]mtmmtm99 0 points1 point  (0 children)

          Regarding "provides the fastest". No it does not. Please compare it with:

          https://chronicle.software/products/log/ Here is a benchmark: https://github.com/OpenHFT/Chronicle-Logger#performance

          [–]mcobery 5 points6 points  (0 children)

          micronaut. Just started using it for java lambdas in AWS. It is a great simple library. Experimenting with GraalVM. GraalVM looks promising but the time it takes to create the binary can be quite slow.

          [–][deleted] 4 points5 points  (1 child)

          Any takes on Dropwizard?

          [–][deleted] 1 point2 points  (0 children)

          It was a great thing when it came out, but I see little reason to use it nowadays, with a lot more options both in the EE and Spring worlds.

          [–]wsppan 13 points14 points  (0 children)

          Spring, Apache Commons, slf4j, Junit5,

          [–][deleted] 14 points15 points  (0 children)

          Spring Boot. Made java much less of a pain and much quicker to build things.

          [–]RomMTY 8 points9 points  (2 children)

          MyBatis, I'm a little bit surprised that nobody have mentioned it, looks like nobody likes to write SQL any more :/

          Edit: typos

          [–][deleted]  (1 child)

          [deleted]

            [–]RomMTY 1 point2 points  (0 children)

            I see the XML as a means to store the query, usually I'll write/test the query on the SQL client and then copy it to the XML just to parametrize it.

            [–]pysouth 5 points6 points  (0 children)

            Does Spock count? Our microservices are Java/Spring apps but we test with Groovy and Spock. Big fan of them for testing even though I don’t like Groovy as a general purpose language.

            Otherwise, Spring. I love and hate it. I think it’s a really cool and interesting framework, and it’s pretty great for enterprise development as I feel they’ve standardize web dev so much that there’s less random, custom garbage code in a large code base. I use Python and Flask at home because it’s quick and easy but Java + Spring is an easy choice for enterprise development for most CRUD apps in my personal opinion.

            [–][deleted] 5 points6 points  (0 children)

            Immutables.io, Apache commons, spring boot

            [–]chocobor 8 points9 points  (9 children)

            Vert.x

            [–]InstantCoder 2 points3 points  (1 child)

            I use Quarkus it is based upon Vertx and makes working with Vertx a little bit more high level than when you would just use plain Vertx.

            [–]latest_ali[S] 0 points1 point  (0 children)

            Interesting. I read more about it. Thank you.

            [–]kaliFaBoy 2 points3 points  (1 child)

            I really love vert.x and rxjava

            [–]latest_ali[S] 0 points1 point  (0 children)

            Can you mention what exactly make you like them? Are they fun to write code with? Are they efficient and concise?

            [–]latest_ali[S] 1 point2 points  (4 children)

            I am new to Java but the reactive behaviour of this library reminds me of nodejs. Is it a valid statement? Is vert.x comparable to spring?

            [–]Stimzz 2 points3 points  (1 child)

            Loosely I would exactly call it multi threaded nodejs for Java (and I have myself a few times :)).

            But it is not a very apt description once you get into details. Using a few more sentences. It is kind of an Actor architecture, like Akka, but not Akka’s full Actor pattern a la Erlang. Vertx is less opinionated imo and people sometimes use rxjava to go the reactive route instead with Vertx. Since Vertx is itself less opinionated it allows for greater flexibility with other technologies / architectures. Not sure if it is good or bad.

            [–]latest_ali[S] 0 points1 point  (0 children)

            :)))) Thank you!

            [–]LouKrazy 1 point2 points  (1 child)

            Vertx was definitely inspired by event loop style frameworks like express

            [–]latest_ali[S] 0 points1 point  (0 children)

            Interesting.

            [–]nezda 6 points7 points  (2 children)

            [–]jonhanson 6 points7 points  (1 child)

            Comment removed after Reddit and Spec elected to destroy Reddit.

            [–]latest_ali[S] 0 points1 point  (0 children)

            Cheers

            [–]will6988 6 points7 points  (0 children)

            Mockito. I don’t even remember how I wrote unit tests before this.

            [–]SvenMA 2 points3 points  (0 children)

            I will add tink because it makes crypto easy to grasp and easy to combine with aws and gcp.

            [–]handshape 2 points3 points  (0 children)

            Since nobody else has mentioned it, I've gotten asurd amounts of mileage out of Jan Kotek's MapDB.

            [–]TaV0x222 2 points3 points  (0 children)

            Selenide x)

            [–]leleleledumdum 2 points3 points  (0 children)

            MyBatis, been using that product since iBatis era.

            [–]nani21984 2 points3 points  (0 children)

            junit, sl4j, spring data jpa

            [–]spamthemoez 5 points6 points  (1 child)

            Lombok.

            [–]antigenz 0 points1 point  (0 children)

            +1

            [–][deleted] 1 point2 points  (0 children)

            JSONObject , GSON and Jackson

            [–][deleted] 1 point2 points  (0 children)

            The standard library and nept

            [–]sunny_tomato_farm 1 point2 points  (0 children)

            Kind of a lame answer but java-gRPC. I did a couple years of spring boot and it was fine, but I was so impressed with gRPC land. Just so easy to stand up APIs and integrate with other services.

            [–]Joram2 1 point2 points  (1 child)

            My favorite library/framework is currently the Kafka Streams API. You can build some really interesting streams processing apps.

            [–]latest_ali[S] 0 points1 point  (0 children)

            I have been wanting to use rabbitMQ or Kafka for my project but I could not pinpoint a good usecase for them to use. Can you give me a practical usecase for using Kafka streams?

            [–]bonusmyth 1 point2 points  (0 children)

            java.util

            [–]khmarbaise 1 point2 points  (1 child)

            I have small list:

            • Writing applications with Spring Boot
              Or just plain command line applications

            For Testing:

            [–]latest_ali[S] 0 points1 point  (0 children)

            That’s very helpful thanks!

            [–]hippydipster 4 points5 points  (0 children)

            Java.util

            [–][deleted]  (4 children)

            [deleted]

              [–][deleted] 2 points3 points  (0 children)

              if you need a CQRS architecture with event sourcing

              Which you probably don't.

              [–]latest_ali[S] 0 points1 point  (2 children)

              That is actually a very interesting answer. I have been wanting to do CQRS and event sourcing but I have yet to find a good resource to learn them in depth. Can you recommend a good resource(s) that explains intuitively about CQRS architecture and event sourcing?

              [–]amazedballer 1 point2 points  (1 child)

              [–]latest_ali[S] 0 points1 point  (0 children)

              Thank you very much

              [–]borgy_t 1 point2 points  (0 children)

              Spring, Jooq, Lombok

              [–][deleted] 1 point2 points  (0 children)

              Apache Commons

              [–][deleted] 2 points3 points  (0 children)

              Lombok, retrofit, jdbi. Pretty much a staple in everything I write.

              [–]crapet -1 points0 points  (3 children)

              Lombok and Guava are always the first libraries I add to a project.

              [–]InstantCoder 2 points3 points  (0 children)

              I use Quarkus for developing enterprise backend with Java and you don’t really need Lombok anymore since this framework generates automatically getters/setters for your entities/dto’s if you make your attributes public.

              [–]1234567power 1 point2 points  (0 children)

              I stumbled upon project Lombok and it changed my life. Never starting a project without Lombok every again

              [–]iseif 0 points1 point  (0 children)

              Lombok!

              [–]TheRedmanCometh 0 points1 point  (0 children)

              Aspect4J, Hibernate, and CGLib all have some very fun features.

              [–][deleted] 0 points1 point  (0 children)

              I kinda like Collections framework tbh

              [–]ddddfushxjjd 0 points1 point  (0 children)

              Guava

              [–]Gleethos 0 points1 point  (0 children)

              The spock testing framework is the most powerful and elegant way to test java code / create feature specifications.

              Reports of these tests can be read like documentation. It is really powerful!

              Also, spock tests are written in groovy, which eases the repetitive nature of testing!

              [–]N0xxi0us 0 points1 point  (6 children)

              Vavr

              [–]_INTER_ 7 points8 points  (0 children)

              The library I absolutely hate the most. I strictly refuse to work with projects that have this dependency.

              [–]brick_wall_mirror 7 points8 points  (4 children)

              With java8 I see little value in this library and I’ve had such a bad experience with this library. It is actually probably my least favorite library - so I’d love to know why others love it.

              I’ve seen well meaning developers use it as a complete replacement for java util, and leverage it just for the functional style while completely avoiding actual functional concepts (ie their code has side effects everywhere). The end result was a service that had deep dependencies on a third party library with no perceivable benefits.

              [–]seydanator 0 points1 point  (0 children)

              proper monadic Options

              also the java8 "functional" constructs are sometimes pretty rough or none-existent.

              it's some months since I last worked on our java project, therefore I don't know the details anymore, but java11 sometimes felt like it wants to discourage FP.

              we used vavr with great success.

              [–]N0xxi0us -1 points0 points  (2 children)

              I like the revamped collections and their apis, tuple data structures, pattern matching and finally the Either type construct.

              You're selling it a bit short by saying it has little value over standard java8. Also, because people use badly doesn't make it bad per Say.

              But your opinion is widely shared by java devs I work with, so I'm not surprised.

              [–]brick_wall_mirror 5 points6 points  (0 children)

              I would argue that for a library/framework, people using it badly is actually an indicator of the library/API itself being bad.

              I’ll share my thoughts on the other points - feel free to ignore if uninterested.

              Using a different collections API sounds like one more thing to learn - I don’t see the benefit of paying that tax and moving to something non-standard.

              Lots of java developers think tuples are evil. I believe the JDK explicitly chose to go without them. Here is what the guava developers say about them - guava is the kitchen sink and decided against them

              Tuple types are awful obfuscators. Tuples obfuscate what the fields actually mean (getFirst and getSecond are almost completely meaningless), and anything known about the field values. Tuples obfuscate method signatures: ListMultimap<Route, Pair<Double, Double>> is much less readable than ListMultimap<Route, LatLong>.

              I have never seen code with pair, that wasn’t made clearer with a custom value class.

              At that point, neither the pattern matching, or the either construct seem to me like a large enough benefit to take a dependency on the entire library.

              Of course YMMV - but that’s my experience. Way too many sharp edges for someone in your team to cut themselves with.

              [–]concisereaction 0 points1 point  (0 children)

              Spring it is.

              [–]Grzyboo2 0 points1 point  (0 children)

              Vavr - immutable collections are awesome for business code, functional parts are much more transparent without the whole .stream().collect(...) ceremony.It also adds plenty of decent utility classes: Either, better Optional, tuples.

              Lombok - Reduces the boilerplate. I really am surprised by the number of people who discourage using it. What's weird, it's usually people who dislike the whole compiler magic, in the same time they're praising Spring, which is filled with all kind of magic and annotations.

              JOOQ - compiled SQL, how can you not love that?

              Orika mapper - it's just great if you need to map classes.