DEV Community

Discussion on: Pitch me on Java

Collapse
 
leob profile image
leob

Probably what you abhor is the verbosity - that got quite a bit better with the most recent version(s), but still ... there's also a culture in the Java world of being in love with 'patterns', with layers upon layers upon layers, and with over-engineering in general ... I worked with Java for a long time, but for me moving to other languages and ecosystems was a breath of fresh air.

Collapse
 
codewander profile image
codewander

test induced design damage

Thread Thread
 
leob profile image
leob

Lol and that is? TDD (if that's what you mean) is generally a commendable technique, it's not necessarily the reason why all of the Java software got so complex, it's more the mindset that everything needs to be infinitely generalized and abstracted to death, even when there's no reason to do so.

Thread Thread
 
codewander profile image
codewander

dhh.dk/2014/test-induced-design-da... - that was the article that got me thinking that hexagonal architecture, which I first encountered in reading about java (and scala) patterns, was part of a pattern of over engineering in some circumstances.

Thread Thread
 
leob profile image
leob

Ah right, interesting article ...

The problem is the misconception that all tests must be "unit" tests in a pure sense - no database, no I/O, only calculations ... that's of course nonsense and impractical, and that's not what TDD says.

If you accept that a large part (the largest part) of your tests just execute web requests (but without talking to a real web server over the network), and use a (test) database, then TDD can still be applied perfectly well without having to use Hexagonal or such extreme stuff.

So I'd say don't blame TDD, blame people who don't understand how to implement it in a practical way. Oh and Hexagonal Architecture is cool and interesting, and very relevant ... for less than 5% of all apps/systems ;)

(the 5% is almost certainly an exaggeration)

Collapse
 
liamjoneslucout profile image
liam-jones-lucout • Edited

You've really hit the nail on the head here. I'm working with a Java dev on a Typescript project at the moment and he's really struggling to get out of this mind set. Especially wrapping everything in a class

Thread Thread
 
leob profile image
leob

Yep ... :)

First thing he needs to do is forget and unlearn the heavy OO baggage, and throw that thick "patterns" book (the infamous "Gang of Four") out of the window ;)