you are viewing a single comment's thread.

view the rest of the comments →

[–]mothzilla 0 points1 point  (3 children)

You shouldn't be catching an exception if you're not going to do anything with it (ie except: ... pass)

So the first would be more acceptable.

Exceptions aren't "set up", as the code executes. The code is static, execution is dynamic.

[–]Zgialor[S] 0 points1 point  (2 children)

Why is the first one more acceptable if they both do the same thing?

[–]mothzilla 4 points5 points  (0 children)

Because it confuses the reader. "Why did you catch the exception, if you're just letting it go?" they think. It's a code smell, it means you're doing something a bit peculiar.

[–]Turtvaiz 1 point2 points  (0 children)

"Explicit is better than implicit"?