4 ms·
> I don't know how many times I've come across "catch" blocks that are empty or something equally inappropriate. Nothing was gained. It turns out that programme
by shepherdjerred 2y ago
> I don't know how many times I've come across "catch" blocks that are empty or something equally inappropriate. Nothing was gained. It turns out that programmers will still forget no matter how hard you try to hold their hand.
You are right, but the difference is that the programmer is making the choice to ignore that error versus accidentally ignoring the error.
- randomdata 2y agoThere was no indication that it was an active choice. I'm speaking to where it was clearly incorrect behaviour, not where one honestly wanted to ignore the condition. I'm assuming these programmers would write out the boilerplate (perhaps even automatically by some IDE feature) and then forgot to return to it to fill in the logic. And fair enough. It would be just as easy to forget to do that as it would be to forget to handle errors in any other language. There is no silver bullet here.
- hot_gril 2y agoAdding a try{...} with an empty catch{} takes a lot more effort than simply forgetting to do something with an error return value.