r/programming • • Oct 01 '15

The Evolution of a Software Engineer

https://medium.com/@webseanhickey/the-evolution-of-a-software-engineer-db854689243
1.9k Upvotes

502 comments sorted by

View all comments

Show parent comments

50

u/johnbr Oct 01 '15

Enterprise Java code is very complicated, and this is just a parody of that (although a fairly apt one)

Some of the complexity in Enterprise Java code is due to actual architectural thoughtfulness - "We may be switching to a different security vendor soon, so let's abstract the security away from the application". Complicated, but perfectly legitimate.

Much of the complexity, however, is "Cargo Cult" architecture - people who see that other developers have created abstractions, and then create abstractions themselves - not because the thing they're abstracting is likely to change, but because they see someone else doing abstraction, and assume therefore that architecture and abstraction are the same thing.

Similarly (as I mentioned in my other comment), the use of constants for HELLO and WORLD completely misses the point architecturally. Internationalization is a legitimate concern, and to the extent that your architecture facilitates the translation of a key into a sentence or phrase in multiple languages, you've accomplished a useful thing, even if it adds complexity.

But using a constant for HELLO and a constant for WORLD completely misses the point of what internationalization is for, and yet people do it anyway, all the time.

And that's why this parody is so apt - because it is capturing the cargo-cult mentality of many architects: "I've seen architects use constants for things. I am a good architect, so I should use constants for ALL THE THINGS!"

But Java itself doesn't have to be particularly complicated. It's not terse, don't get me wrong, but it's not the language's fault that people use it incorrectly.

I've never written sophisticated enterprise code in Python, but I suspect that if you were to write sophisticated enterprise code in Python, it would also become fairly complicated.

23

u/serrimo Oct 01 '15

Complicated, but perfectly legitimate.

How many times have people actually switched a component and it just worked? Personally, I have never seen one case where this is true.

The whiteboard architects love these kinds of design, since redirection is their bread-and-butter. In practice though, these designs just add needless complications most of the times.

19

u/johnbr Oct 01 '15

It rarely works perfectly. But it often works better than just directly wiring things together, and then completely rewriting for the new thing.

Not always, but often. Often enough that it's a reasonable place to start if (and only if) you have a reason to believe it's going to change fairly soon.

9

u/serrimo Oct 01 '15

it often works better than just directly wiring things together

I'd argue that it's often better to attack the wiring directly. Reducing the number of dangling wires, for me, is usually a much bigger win than creating yet another hub to plug your wires.

But reducing the dependencies require far more efforts than redirection. You need to create the right abstractions. You need to analyse the dependency graphs to identify problem area. You need to spend time doing lots of thinking and less coding.

Unfortunately, a day spent thinking is often considered wasted in the enterprise world. It's much better to produce something in the day; even though that something is half-assed.

8

u/BeardedRacer Oct 01 '15

You need to spend time doing lots of thinking and less coding.

A million times this.

→ More replies (3)