3 ms·
I've written old Java (C++ like), enterprise Java, Android Java, and currently am writing modern Java. From Android and forward there have been improvements in
by bliti 11y ago
I've written old Java (C++ like), enterprise Java, Android Java, and currently am writing modern Java. From Android and forward there have been improvements in verbosity and boilerplate. Modern Java (8) is actually nice. Yes, the enterprise code is still approaches a rude goldberg machine level of complexity and verbosity but that is changing. Frameworks like spark simplify the web side, and projects like Jhipster (horrible name, great project) automate a lot of the boring work and provide a good base to work from.
At the end of the day, verbosity in Java is mostly due to its ecosystem. Its quite different than that of smaller languages like Python, or Go. Where there is a community wide effort to share code and make things simple. Not so in Java.
- bjz_ 11y agoStill no type inference, pattern matching, or ADTs. In a statically typed language that causes lots of verbose ceremony that shouldn't be needed in the 21st century. We've known how to do this stuff for decades. That said, I would take Java's verbosity over Ruby's lack of static types. I write Ruby in my day job, and refactoring is a pain, and the same old type errors keep popping up day after day, causing 500s in production. It seems no amount of TDD can prevent them.
- bliti 11y agoAgreed. It does cause lots of verbose ceremony, as you put it (I'm stealing that). Its quite the experience using a Java IDE and noticing how much code is automatically included by pressing tab. Quite comical that Netbeans has shortcuts words for printing to terminal. Your second point really hits home. I've been battling with Python and runtime types. Its just the nature of the beast. That's why I've been focusing more on languages with solid type systems. I will happily trade verbosity for types. :)
- kazagistar 11y agoYeah, Java 8 can be quite clean and expressive. The biggest problem with Java 8 is the lack of support for the new features within the extensive library ecosystem. You either have to revert to using horrible, old, and verbose patterns, or abandon many of the libraries which, to a large extent, are the reason Java is so useful in the first place. I am not convinced this will ever be fully fixed; the burden of legacy is just too great.