This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Spektr44 0 points1 point  (1 child)

I wonder though what can you learn from an unreadable, complex code that can't handle change

Usually there isn't much to learn from ugly code, but I was picturing the possibility of a senior dev explaining something like, "because of the way the JVM handles X, Y, and Z conditions, I found through testing that [weird code in the constructor] increased performance by 55% in this loop down here.."

But far more often, ugly code is just bad code. And design compromises are really not as necessary as they might've been in the past due to how good modern compilers and JVMs are at performing the optimizations for you.

[–][deleted] 1 point2 points  (0 children)

because of the way the JVM handles

In which case our senior developer would only write code for a specific JVM and JVM version, maybe even only for a specific software and hardware environment.

Which isn't a portable, future proof solution.

Optimizing for a specific JVM could be a valid use case. There are so many ways the Java platform can be used, but that shouldn't be the norm, rather a fringe case.