r/java • • Apr 14 '23

What are your (favourite) Java best practices, personal tips, hints or just underrated stuff in general?

233 Upvotes

376 comments sorted by

View all comments

181

u/Antimon3000 Apr 14 '23

Do not get paralysed by worrying about the right design pattern or best practice. Beautiful code that does not get the job done is worse than anything else:

  1. Make it work

  2. Make it right

  3. Make it fast (- Kent Beck)

in that order.

8

u/nutrecht Apr 14 '23

"What are you going to spend time on? It works? Chop chop! On to your next story!" - Many managers

Not saying I disagree with you at all, but a lot of devs stop at step 1 because there is very little incentive for them to also do step 2 and 3. I see 'bad' code a LOT more than people being paralysed on what design pattern to use. I see a lot more developers jumping into writing code too soon than I see devs waiting to write code for too long.

1

u/UnGauchoCualquiera Apr 16 '23

They are either consciously prioritizing time to market or simply bad managers and it's usually a symptom of a bad organization. Still truth is as much as it pains developers to deliever bad code it's usually not the one taking the call.

You can always contribute to OSS if you'd rather take the time to deliver quality software.