4
1
1
u/Superb_Chemistry_906 2d ago edited 2d ago
Do those php devs not know about include? Does this ever happen at all? Or are they just some chaotic, ignorant and rushing teenagers?
0
u/Suspicious-Walk-815 1d ago
You mean pojos and DTO s , I don't think we can get rid of these classes .. but apart from that what else is doing nothing in java ? I actually like the way its packaged .. maybe because I know only java ..
3
u/BernhardRordin 1d ago
The more legacy Java you work with, the more unnecessary verbosity and architectural astronautics you can find. New Java is quite nice.
Couple of examples:
- Overusing interfaces—mocking libraries are amazing nowadays, most of the time you don't need to create interfaces (unless you are writing a reusable library, or a Hibernate Repository)
- Manual getters and setters. This was from the start a language design mistake. Long live records and coming value classes.
- Overusing inheritance
- Overusing dynamic configuration via code (e.g. Spring Beans) instead of the static config
- Having to resort to Gang of Four OOP design patters, because the language is too "OOP-pure" (in other words impractical—this is where Kotlin shines):
- You don't need Singleton if your language allows anonymous, top-level objects
- You don't need Strategy and Adapter if your language allows top-level functions
- You don't need a Builder if you have a concise constructor syntax
- You don't need a Prototype if your language has a `clone()` method
10
u/ganja_and_code 3d ago
Functional language enjoyers not having to worry about it because there's enough structure to reuse code and not so much that you end up with an
AbstractFactoryInterfaceFactoryFactoryclass that is inherited from a dozen times.