If it's really a big deal, you're going to have to prove to them why they're wrong.
They catch and suppress Throwable
s
It shouldn't be very hard to come up with some test input that causes a catastrophe.
return null
s
This isn't as serious as suppressing Throwable
, but can still cause problems. Show them where their code is causing NullPointerException
to be thrown. You should also show them what to return instead of null
(empty array, Null Object, etc.) and how much easier it is to work with in the calling code.
concatenate String
s in large loops
This isn't nearly as bad. If it were me, you'd have to show me that the loop in question was the bottleneck in the system and that the concatenation was slowing things down significantly. Benchmark the application and find out.
For any practice that you see as a problem you need to be able to demonstrate two things:
- Why it's wrong.
- The right way to do it.
If you can't do both, then you're not giving them enough reason to change their habits.