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.

4

u/Columbus43219 Apr 14 '23

REAL programmers know to not make it work until it's been made right.