DEV Community

Discussion on: 10 Skills Java Programmer can Learn to Accelerate their Career

 
stealthmusic profile image
Jan Wedel

From my experience, building business applications in vertx and also spring web flux has 5-10x the costs for writing, reading and maintaining code than spring boot with web mvc. We have used web flux in very limited use cases successfully because we needed the performance there.

Thread Thread
 
siy profile image
Sergiy Yevtushenko • Edited

You trying to read my answer as if I promote Vert.x. This is not so. And this does not justify use of Spring Boot. If you really can't write async code in Vert.x style (which is definitely not so easy due to used processing model), then there are countless smaller frameworks, which support familiar JAX RS endpoint style. If there is just no way to leave comfort zone, then Micronaut might help as well. As I've mentioned above, it's Spring done properly, with handling at compile time all things which can be handled at compile time, like DI and MVC. And as far as I can see, it is made Spring-like as much as possible.

Spring survived for so long time not because of quality of its design. It survived because of Java great backward compatibility. When backward compatibility was basically broken with Java 9, there is no way for Spring to survive as it is (in regard to design). All those component scans and countless layers of run-time reflection do not work well with modern Java, requiring to open all application packages to Spring and defeating whole purpose of modularization.

Finally few words about performance. You're right, not everybody needs good performance. But I'm looking at performance from other perspective - high performance means that less resources are necessary to handle specific load. Less memory, less CPU, less instances in cloud, less energy. This results to cheaper bills from cloud provider and lower environment impact.

In fact one of the things I don't like in Spring most is that it grew up whole generations of developers who assume:

  • resources are unlimited
  • nobody was fired for using Spring
  • everything in Spring is perfect and follows best practices
Thread Thread
 
stealthmusic profile image
Jan Wedel

In other words, "1 million of lemmings can't be wrong".

Phew... do you view yourself as the only smart person amongst millions of mindless spring developer lemmings that understands how bad spring actually is? From my experience, most developers I've met are very smart. And they do always strive to reduce unnecessary work and to automate and simplify stuff in the way. Spring helps a lot with that.

Funny side-note here: I was really hating Spring until Spring Boot came out and avoiding job offers just because of the fact that they were using Spring.

Aside from that, I give that point regarding resource consumption. This is going to be a bigger and bigger issue in cloud scenarios. But also here, Spring is not the issue, neither in memory consumption nor in performance. A plain Spring application does not consume much memory and starts really fast (even with thousands of dependencies and auto-configuration). The JVM however does which is a problem when you are running dozens or hundreds of microservices, each starting a JVM with 100-200MB RAM first. Then, one if not the one important factor regarding start-up time and memory consumption is Hibernate/JPA which people usually blame on Spring.

So if you use plain spring, maybye even Spring-Fu (Functional bean definition) without JPA you can already build a native-image with Graal and get a start-up time of 1ms and a couple MB RAM usage. But if you add all that convenience that makes you faster during development, it's going to be much slower and more memory consuming at the moment.

I find both Micronaut and Quarkus interesting and I follow those projects which are build from the ground-up as cloud native frameworks. But since Spring is also evolving in that direction and has a much much richer ecosystem, I don't think they will take over any time soon.

So coming back to the initial posters topic:

10 Skills Java Programmer can Learn to Accelerate their Career

I honestly don't believe, that other frameworks should be put on that list at the moment. However, they definitely belong on a "10 technologies every Java developer should check out" list or similar.

Thread Thread
 
siy profile image
Sergiy Yevtushenko • Edited

Phew... do you view yourself as the only
smart person amongst millions of mindless
spring developer lemmings that understands
how bad spring actually is?

Nope. I'm using Spring for last 10 years or so, and vast majority of Spring devs I've worked with had exactly the same opinion about it. But my argument was not about who is smart and who is not. It was about using Spring popularity as a proof of quality.

So if you use plain spring, maybye even
Spring-Fu (Functional bean definition)
without JPA you can already build a native-
image with Graal and get a start-up time of
1ms and a couple MB RAM usage. But if you add
all that convenience that makes you faster
during development, it's going to be much
slower and more memory consuming at the
moment.

You basically just repeated what I wrote above - Spring with it's "majic" is a CPU/Memory hungry bloatware.

I honestly don't believe, that other frameworks
should be put on that list at the moment.

Spring should not be in that list either.