Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
You forgot a little detail, that's code we got for informatics class:
try
{
// something
}
catch (Exception e)
{
// ignore Exception
}
Yes, this shitty formatting is intended -
ddephor44467yThat's quite common. Some devs use it to interrupt the control flow from anywhere within the try-block with an exception. That avoids a few if/else or gives you a single point of return at the end for closing operations (like 'finally' in java).
I've seen a similar approach with loops that can be left anywhere with a break-statement.
I don't like such stuff, I think it's confusing, and before doing it that way, one should think about the design. IMO there is always a better solution than that. -
@ddephor After some time in the industry, it seems to me that no one cares about design and everyone makes dumb decisions based on money.
-
ddephor44467yOh, I forgot something...
The best version of that, that I've seen was using goto to abort control flow on error.
People can be very creative... -
@CaptainRant oh god my backend devs used to do that all the freaking time.
"if I head the exception, then everything is going well", needless to say it didn't go well
Related Rants
try {
// something
} catch (SomeException e) {
}
Swallowed Exception.. what the fuck is wrong with you?! And I see this shit in a lot of places in the code!
devrant
dumb
java
exceptions
bad