2 ms·
Convert your code to Kotlin (idea will do this for you). It won't get rid of the boilerplate automatically but it will de-clutter your code and then put you in
by jillesvangurp 7y ago
Convert your code to Kotlin (idea will do this for you). It won't get rid of the boilerplate automatically but it will de-clutter your code and then put you in a position to refactor to be more idiomatic Kotlin. Once you get that sorted, you can start thinking about creating a DSL for things you do a lot and get smart about eliminating boilerplate. IMHO javascript/typescript looks more boiler plate heavy these days than well written Kotlin.
I know bashing java for boilerplate and verbosity is popular but a lot of its reputation is people doing repetitive stuff without reflecting on better ways to do these things. I see the same patterns and mistakes in other languages. The best code is the code you don't need to write.
Likewise needless abstractions and over-engineering are a problem in many places. Java certainly has seen its fair share of that and its a reason I avoid the entirety of the Scala ecosystem in principle. Nothing wrong with the language but it seems to provoke over-engineering.