DEV Community

loading...

Discussion on: Python vs Java

siy profile image
Sergiy Yevtushenko

Java has great 'final' keyword and once you make field final, even Idea does not propose to create setter for it.
You missed the whole point of Integer and other relevant classes. They are immutable by design. And, frankly, boxing/unboxing works transparently so nobody actually cares. All cases where difference is sensible (for example, large collections), already covered by various libraries.
Java "best practices" described in "Effective Java" and they are quite close to what you're promoting. Unfortunately for Java there also Spring, which definitely promotes a number of very bad practices, including mutable beans and using exceptions as part of business logic.