10 comments

  • e7h4nz 2 hours ago
    I worked on a core Spring Boot project for five or six years at a very large enterprise. In my opinion, the most dangerous thing about this framework is that it makes its core users feel far too self-assured.

    When looking at problems, your mind becomes consumed with how to force everything into design patterns—like architectural separation, DI, or interface / implementation split. This causes developers to lose sight of the actual essence of the problem because they are obsessed with conforming to the framework.

    Because the ecosystem and toolchain surrounding Spring Boot and Java are so mature and well-supported, it is very easy to find community tools that make you feel like you are doing things the "right way."

    I only realized these issues after I left Spring Boot and Java development behind. Now, I much prefer using TypeScript or Python to write code (for example, web servers).

    I also prefer using various SaaS solutions to handle authentication and user registration rather than rebuilding it all myself with Spring Boot Security. I honestly never want to go back to the days of writing Java again.

    • antonymoose 1 hour ago
      Funny how that works - I started with Spring both before and after Boot as well as some Scala.

      I wouldn’t trade Java / Spring for the world. It forces a coherence, perhaps not perfectly, but it provides guidelines to follow.

      I’ve been stuck in Node / TypeScript / Microservice hell for most of the last 15 years and I couldn’t hate it more. The open-source ecosystem is extremely lacking, even now, on something like a good XML library. I think we’ve got four different ones installed in our core platform each handling different needs (traversal, generation, manipulation, validation).

      On top of it all, since there isn’t “one way” we’ve got several dozen micro services. There isn’t a single bit of consistency other than “Express.” Logging, authentication, routing, validation - it’s all completely up in the air. It robs us all of efficiency from the lack of common language and pattern. We spend more time refreshing ourselves on any given project than doing feature work or bug fixes.

      Madness!

      • BariumBlue 24 minutes ago
        I hear this a lot from a lot of my coworkers who like Java Spring - they trust Spring to do things right, more than themselves.

        On the other hand, I hate Java Spring because I feel like I don't trust it - it doesn't let me look into and understand the internals easily, making me feel like I'm afloat on a pile of abstracts I'm not allowed to look down into.

        Looking at some other projects enterprise js/ts codebases though, I see a lot of "I don't understand how this works so I'll try random things until it works". In that kind of environment, I can understand the attraction of Spring - it's not great, but it also won't be a flaming pile of unbaked abstractions.

      • ekropotin 45 minutes ago
        I’ve Been stuck with Spring for many years too and I think it’s just awful choice for micro services that need to scale, simply due to startup time.

        Not to defend Nodejs ecosystem - your points are 100% valid.

        With that in mind, I think Go is much better option.

      • e7h4nz 1 hour ago
        Removed microservices and RPC, keep all TypeScript codes in a single monorepo. Avoiding `any` and using ts-rest automatically keep types synchronized between the web and frontend applications.

        This has made my life much easier.

      • reeredfdfdf 38 minutes ago
        I agree. Whenever I've tried jumping into NodeJS world, I quickly get overwhelmed by the lack of obvious "right" solutions to common problems. There's no way to know which of the dozens of ORM's, auth libraries or whatever will be still around 10 years from now. With Java & Spring the choice is always obvious.

        Of course there are "batteries included" frameworks for NodeJS too, but they all seem to be unstable compared to Spring Boot.

    • ecshafer 2 hours ago
      I like Java fine. I would probably prefer Ruby, Rust or LISP given the chance. But I can't disagree with anything you say. So many Java enterprise shops have absurd inheritance and "design pattern" abuse that makes it harder to actually work with the code, and slows things down.
    • chasd00 1 hour ago
      > I also prefer using various SaaS solutions to handle authentication and user registration rather than rebuilding it all myself with Spring Boot Security.

      i haven't used Spring in a decade but even back then Spring Security had support for all kinds of federated authentication/authorization providers and standards.

    • cogman10 1 hour ago
      Spring is such a massive framework and it definitely has parts that aren't, frankly, well done. More than once Spring has ultimately been the source of performance issues for us with the solution being to ditch spring and do things with just the JDK. A lot of those cases have been fixed, however, even in the best case spring will take something that could have been a single function call and turn it into a maze of 20 different function calls because it's handling all sorts of weird edge and corner cases that aren't applicable to your code. It also doesn't help that some things are simply bolted in which makes it even harder to understand what is going on under the covers.

      It also doesn't help that it's really easy to end up bringing in the entire framework for what you assumed were single function portions of the framework.

      That said, it's the framework you probably want to use if you are doing Java. Just not if you are doing fast java.

    • smrtinsert 1 hour ago
      Nothing about Spring forces you to use or engage in or use design patterns. If it does im pretty sure that's a plus. Juniors can have clear path towards being productive and feel quickly oriented.

      Like sibling comment mentioned you can integrate anything with Spring Boot. Its a high productivity framework to accomplish alot. Your frustrations speak more to the job you took rather than the framework they forced you to use.

  • stackskipton 2 hours ago
    Ops person here who has supported Java/SpringBoot applications. I think most of dislike of Java apps comes not from language or framework BUT from fact that most Java using workspaces are filled with mediocracy. They tend to be businesses with products that have extreme moats and thus quality of software barely matters. I imagine most people who would even read this medium article are dreaming of better than that.
    • evantbyrne 17 minutes ago
      There are certain non-software industries that seem to have strong hiring preferences for workers who started in the industry over computer science chops, and a lot of those tend to use Java. For example, biotechs.
      • stackskipton 2 minutes ago
        Because most of time, understanding the business logic is harder than writing to the code in these industries.

        Java is default since it's what taught to many college graduates with added bonus that's taught to most college grads in Indian subcontinent so outsourcing is much easier.

    • ecshafer 2 hours ago
      I 100% agree. I have seen enterprise spring applications that throw away all of the speed through huge amounts of hot path object creation, nested loops, absurd amounts of factories, etc. After going through enough AbstractFactoryFactory calls to make object in an n^3 loop, the framework doesn't matter.
      • switchbak 2 hours ago
        There really is an unlimited potential for crappy code in the enterprise. I imagine the volume will increase drastically in the age of AI.
        • the_arun 1 hour ago
          Usually languages are not the issue. It is the code that we write. As long as languages help us to find/debug a problem caused by crappy code - we should be good. Coding is kinda creative work. There is no standard to measure creativity or pitfalls of using wrong patterns. The incidents & RCAs usually find these. But most of the times it is already too late to fix core problem.
    • dukeyukey 1 hour ago
      Alternatively, I think of Java and Spring Boots as being incredibly valuable by letting companies that don't really have software as a core competency to make reasonably performant and structured applications.

      Mediocrity will never not exist, and you unlock a lot of value by optimising for it.

  • moondowner 1 hour ago
    Switched from Spring Boot to Ruby on Rails 3 years ago.

    I expected to see some new Spring 'tricks' in this post, but it's pretty much regular things that people might do in larger codebases.

  • exabrial 31 minutes ago
    > What makes the CAS codebase impressive is the discipline of applying all of them consistently, across 400 modules, for years.

    I think this is the main point. You can write good code in any language following this concept.

  • jillesvangurp 34 minutes ago
    - Swap out Java for Kotlin. The Spring guys won't officially drop support for Java; but a lot of their recent releases are becoming very Kotlin centered. Seriously, it's much nicer to use from Kotlin. I've done both.

    - Go for declarative Kotlin DSLs over annotation magic for most things. Much easier to debug. It's just function calls. And DSLs are nice in IDEs with autocomplete.

    - Keep it simple. It's a huge framework. But you probably don't need most of it.

    - Don't go Spring everything, a lot of stuff in Spring is a bit experimental (Spring AI/MCP stuff) or a bit bare bones (Spring Data, it's a limited and extra level of indirection you mostly shouldn't need) or flat out misguided/over-engineered (Spring Batch, good alternatives are available for that).

    - Decide on synchronous or asynchronous IO. The former is a lot more scalable now that Java has green threads. The latter is relatively painless from Kotlin but an absolute PITA from Java. They are very different internally and both have their pros/cons. If you need async, Kotlin co-routines is the easier path to do that. Either way, it's one of the bigger decisions to take.

    - Don't copy their way of deeply nested inheritance hierarchies. Very much in fashion 20 years ago; a bit of an anti pattern now. Internal code complexity is the part I like least about Spring. And it has some really byzantine stuff in there with 5-6 levels of inheritance or worse.

  • sidcool 3 hours ago
    Hacker news likes to dunk on Spring Boot, but its usage in enterprises is very very high.
    • dzonga 1 hour ago
      it doesn't mean that usage of something being very high is a clever idea.

      lots of people take meth - so are you gonna take meth too.

      ```@EnableConfigurationProperties(CasConfigurationProperties.class) @EnableScheduling @ConditionalOnFeatureEnabled(feature = CasFeatureModule.FeatureCatalog.SimpleMFA) @AutoConfiguration @Import({ CasSimpleMultifactorAuthenticationComponentSerializationConfiguration.class, CasSimpleMultifactorAuthenticationConfiguration.class, CasSimpleMultifactorAuthenticationEventExecutionPlanConfiguration.class, CasSimpleMultifactorAuthenticationMultifactorProviderBypassConfiguration.class, CasSimpleMultifactorAuthenticationRestConfiguration.class, CasSimpleMultifactorAuthenticationTicketCatalogConfiguration.class, CasSimpleMultifactorAuthenticationWebflowConfiguration.class }) public class CasSimpleMultifactorAuthenticationAutoConfiguration { }```

      this is what we mean by "JavaCulture" - java | JVM really wonderful things but the culture is what sets these things back

      someone can't just go in and understand things - they have to understand a bunch of notations too.

      then if you work at a place and try do things differently the same people will tell you to revise your PR cz it ain't software engineering (or it won't scale)

      • mindcrime 1 hour ago
        That's a ridiculously extreme example, IME. Having been working with Java for 25+ years, I've never seen anything like that in code written by a shop I worked at, FWIW. And as a corollary I'm about 100% certain that you could find some equivalent extreme case to use as an example to dunk on any language/platform.

        this is what we mean by "JavaCulture" - java | JVM really wonderful things but the culture is what sets these things back

        Maybe there are still some Java shops out there living like this. But to me, this is a 20 year old outdated notion. shrug

      • _ZeD_ 13 minutes ago
        dude, that is a configuration.

        it is completely declarative and lives in the best place, near your code, not on some other inaccessible repository.

        what have you preferred? a json file? a yaml one?

        I had them, and I find the annotations are more readable than other solutions.

    • geodel 2 hours ago
      Huh, Enterprise usage of Blackberry was very very high and then it was not. And at one point SOA, SOAP/WSDL/XML usage was very very high and now I am told in my very enterprise job I'd be fired if I dared bring those names up.

      Usage being high doesn't say anything about quality or suitability of a product specially in enterprise settings.

    • the_gipsy 1 hour ago
      Cuisine Magazine likes to dunk on McDonalds, but its the most popular choice of dining.
    • dukeyukey 1 hour ago
      Even in startups, lots of places are on Spring Boot (albeit more often using Kotlin over Java).
      • bberrry 1 hour ago
        My favorite stack, Kotlin with Spring Boot. A real delight to work with
    • tonyedgecombe 2 hours ago
      Yes but enterprise software is some of the worst software you will encounter.
      • sidcool 2 hours ago
        Not Spring Boot's fault :)
        • __alexs 2 hours ago
          Not a strong indicator that Enterprises have good taste though is it?
    • nilamo 2 hours ago
      I'm not that deep into Java, but I was under the impression that things like Quarkus were starting to replace Spring in enterprise use...
    • fiftyacorn 3 hours ago
      it saves a lot of reinventing the wheel
      • rockyj 2 hours ago
        And at the same time, gives you a dozen of footguns. This is just a list for the gotchas in the "@Transactional" annotation - https://dev.to/closeup1202/8-spring-transactional-pitfalls-t...

        Now read up on all the dozen of annotations. But yeah, we did not want to "re-invent the wheel".

        • fiftyacorn 2 hours ago
          Im comparing against node equivalent ORMs and find spring consistently better. Yeah ive got to read up on annotations - but when it comes to transactions its always worth revisiting them to check for changes
    • smrtinsert 1 hour ago
      And startups not in the SV echo chamber. They happily exist and make money without worrying about supply chain attacks and js engine of the week.
  • robmccoll 3 hours ago
    Does this app take 5 minutes to start? That's so much dynamic Spring magic. Also, how do you keep track of control flow when anything at anytime could have been overridden by something else? It seems like tracing and debugging this thing would be like exploring someone else's codebase every time.
    • krzyk 14 minutes ago
      Who cares about startup times if apps is started only when new version is deployed?

      And 5 minutes is a bit long, maybe someone is doing some database operations during start?

    • switchbak 2 hours ago
      The class loading magic means you need to be exceptionally careful about things that would otherwise be very innocuous. It’s the rule, not the exception - that your average spring boot app will be doing tons of expensive stuff at startup. Most of which is unnecessary and was not even intended.

      The JVM doesn’t need this kind of thing either, and it gets a bad wrap from the J(2)EE days, and the “simple” replacement that Spring was supposed to be.

      No doubt there’s some benefits to be had, but I don’t think the trade-offs are worth it, especially at larger scales.

    • smrtinsert 1 hour ago
      The article talks about a specific solution they came up with. No way is this a representative example, they discard a typical pattern way at the top.
  • fpauser 53 minutes ago
    Bodyless classes only for carrying annotations... too much magic for my taste.
  • mergeshield 26 minutes ago
    [dead]
  • faangguyindia 3 hours ago
    I recently inherited java code base.

    Just rewrote it in Go. Now we are using a server which consumes 30% of ram what the existing one used to and the latency and throughput have all improved.

    Don't use these stupid java backend like sprinboot.

    • ludovicianul 2 hours ago
      I wouldn’t reduce it to don't use Java/Spring Boot. Rewrites often (not always) look great because they remove years of accumulated complexity, not because the original stack was inherently bad.

      Just rewrite it in X doesn't "just work" for complex systems. It ignores risk, and the fact that design usually matters more than language.

      • faangguyindia 1 hour ago
        i made 1 to 1 copy, not sliming anything.
      • iririririr 1 hour ago
        usually what you say is correct. but in case of entreprise java, just look at the article. you have no way of knowing or controlling which essential class your application will be running because some intern merged a similarly named class two hundred levels down in the codebase and now that is handling all your db queries. and it's not a bug but a highly praised feature.

        it's useless abstractions for the sake of useless abstractions.

        java was designed so that american architecs could write a few interfaces and cheap workforce overseas could implement the actual code.

        and the EE stuff evolved in a way that features could be shipped just by adding a new component that would inject itself in the right places. java "engineers" have no idea how http or cookies work, but they know where to load the spring-auth bean in a 2mb maven config.

        so, any rewrite from java is an exception to the rewrites are only good because you cleaned up old features rule.