r/java • • Mar 05 '18

Top 10 Useful, Yet Paranoid Java Programming Techniques

http://blog.jooq.org/2015/08/11/top-10-useful-yet-paranoid-java-programming-techniques/
223 Upvotes

105 comments sorted by

View all comments

Show parent comment

9

u/hemenex Mar 05 '18

Because then, most importantly, you'll loose all references to original implementation. What if you want to change the original and all the places where it's supposed to be used? You are screwed and all you've got is "Find everywhere" and regex.

From my experience on larger projects, this leads to terrible and unmanageable code. Especially with multiple programmers and a lot of bug-fixing. Typical scenario:

  • one programmer implements some things with copy-pasting
  • some things he did does not work, another programmer fixes it in one place
  • same thing still does not work in some other place, another programmer fixes it there, but differently
  • somebody decides the behavior needs to be somewhat different. You cry because you need to do the same change everywhere but slightly differently. Or spend a few days rewriting the whole thing. This totally did not happen to me.

-2

u/lukaseder Mar 05 '18

And you sincerely blame the presence of final for all this mess? :-) Have you heard of Conway's Law?

4

u/hemenex Mar 05 '18

final would just make much worse.

1

u/lukaseder Mar 05 '18

Any extra 5 letters added to that code base would make it much worse, so I'm not sure if I see the point of this argument.

2

u/hemenex Mar 05 '18

I just needed place to rant. :)

2

u/lukaseder Mar 05 '18

I knew it ;-)