Give me some of your thoughts on which is a better coding practice/makes more efficient code/looks prettier/whatever: Increasing and improving your ability to use if statem
From what I've been told by more experienced developers and analysts, try/catch is more object oriented and if is more procedural.
I personally don't care.
I'm aware of the fact that a try/catch is slower and causes a performance hit, but if I'm going to use a dozen ifs to validate before I can do what I want to do, I will always use a try/catch to save on the number of lines of code.
It makes my life so much easier to not have to validate anything and if the statement fails, just do what I would have done in my 'else' block...in my 'catch' block.
Sometimes, I obviously enclose some if statements in a try/catch, but anyways.
I use an if when there's only a small number of things to validate (1 or 2) before doing what I need to do.