9
vhoyer
7y

the person who wrote the code I'm maintaining had just learned try {}catch {} seriously, the guy preferred using try catch over ifs...

Comments
  • 2
    Nothing to add here...
  • 1
    gsuahaaah, man, the page was taking 5 minutes to open cause of all this try catchs
  • 2
    @DotSln it was missing just a if (var == null) on a lot of the cases
  • 1
    So he didn't really learn How to use it.
    It's like - I guess everyone knows some chess-rules. But to play it properly is a different thing. 😏
  • 1
    @DotSln yeah, he had just discovered its existing hahaha
  • 2
    @vhoyer ... and now he needs a senpai to teach him how to code smart.
  • 1
    @DotSln well I'd love to xD but he left before I came
  • 3
    I can't understand the problem with his method. I always use try catch to manage any control flow, like throwing a costume exception instead of returns, using exceptions instead of breaks. I can't understand how this could be a problem. 😀
  • 2
    This is actually a coding style mostly used in python but the idea is to use try catches instead of validating information with if statements https://stackoverflow.com/questions...
  • 1
    Try{x}
    Catch {}
  • 0
    @Axis that's very nice to know and interesting to think, but still, we are not using python, and all the catches were empty (not even described what exception it was supposed to throw)
Add Comment