this post was submitted on 12 Nov 2023
24 points (74.0% liked)

Programming

17666 readers
395 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 2 years ago
MODERATORS
 

In this blog, I’ll outline why learning and mastering Spring Boot in 2023 is a worthwhile endeavor, even though there may be a few differing opinions. I’ll also explore how Spring Boot compares to other backend technologies and alternative Java frameworks.

top 18 comments
sorted by: hot top controversial new old
[–] eksb 22 points 1 year ago (4 children)

While you are mastering Spring, I am mastering libraries that do the thing my program needs to do.

While you are trying to debug to your Spring app, which is a huge PITA because Spring is a rat's nest of conflicting configuration paradigms and overlays and fills your call stack with dozens of layers of generated methods, I have finished my work and am ~~at the beach~~ helping my coworker debug his Spring app because he didn't listen to me when I said not to use Spring.

[–] [email protected] 7 points 1 year ago (1 children)

Just out of curiosity, why do you find debugging in spring a huge PITA? Also what do you mean by conflicting config paradigms?

Genuinely curious.

[–] eksb 0 points 1 year ago

Spring combines combinations of environment variables, system properties, files, and classpath resources, and handles a variety of patterns (e.g.: aConfigOption could be configured by system property A_CONFIG_OPTION, aConfigOption, or several other possibilities), so tracking down where the configuration came from is not always easy. Sometimes you think you can just set a property, but it turns out another property triggers loading a resource that overrides yours. This would be fine if applications/libraries clearly documented how to configure them, but most say "config via spring, good luck lol".

And good luck if you are trying to use two different components both built on Spring, and they both rely on the dependency injector settings "db.url". Now you have to start playing games with dependency injector scopes.

[–] [email protected] 6 points 1 year ago

Unfortunately, Spring is still the de facto standard in many companies and deviating from it takes effort and is sometimes completely futile.

[–] [email protected] 3 points 1 year ago (1 children)

I'm curious how you handle API security. It's a bit of a PITA with Spring but I couldn't imagine handling all of it with one-off libraries. If you have a basic CLI type of program or something not meant to receive external traffic I can see how Spring can be overkill.

[–] [email protected] 3 points 1 year ago (1 children)

What’s wrong with spring security?

[–] [email protected] 4 points 1 year ago

Well, I say it's a PITA but I mean that's kind of security in general. It's probably just my companies mismatching of old and new protocols that make it a bit challenging.

[–] [email protected] 1 points 1 year ago (1 children)

What do you use in its place?

[–] eksb 0 points 1 year ago

Nothing? I just use the language features and I use libraries for specific things.

I do not use an automagic configuration and dependency injection boondoggle. I read config in main(), create the objects I need, and do what I need. It is easy to see what my program does; it is easy to see where configuration comes from. It is easy to test any component, because you can clearly see what you need to provide to build the entry point objects.

[–] [email protected] 12 points 1 year ago* (last edited 1 year ago)

As someone who works with this framework for a living, don’t learn it on your free time. It’s absolutely worth learning vanilla Java, but you can learn Spring Boot on the job

[–] [email protected] 6 points 1 year ago (1 children)

Better question is: do you want to work in companies that typical use Java? Those are governments, big banks etc? Typically companies with a LOT of bureaucracy and whatnot. If the answer is yes then learn it because you won't be a day without a job. :)

[–] [email protected] 11 points 1 year ago (1 children)

Major tech companies also use Java… Apple, Google, Amazon, etc.

[–] [email protected] 3 points 1 year ago

Yeah but its hard to get into those, banks and whatnot however...

[–] [email protected] 5 points 1 year ago

Based on the fact that almost[*] every single Java shop I've been in used Spring, I'd say yes.

[*]: aside from one which used bare tomcat with a bespoke, thousands line long, bug ridden router for a core service. i guess they didn't know about spring because every java service since then uses it.

[–] [email protected] 4 points 1 year ago

What are you using instead?

[–] snowe 3 points 1 year ago

It's worth learning it just to understand how large complex DI frameworks work in general, allowing you to understand way more, like Quarkus, Micronaut, etc. even extending outside of Java/Kotlin.

[–] [email protected] 2 points 1 year ago

It's only worth it if you're planning to work in Java or one of the other JVM languages.

If that's what you are striving for, is worth it to spend the effort ahead of time. If your goal is more agnostic to tech stack, learning Spring Boot won't be worth it until you land a role that uses it.

It might be worth dipping your toes in the water anyways. But frameworks like that shouldn't be bothered with without inherent interest or need.

Personally, I've no interest in working in Java, Scala, or Kotlin so I'll skip it.

[–] [email protected] 1 points 1 year ago