Thorough use of 'if' statements or 'try/catch' blocks?

前端 未结 9 1964
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-12 03:14

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

9条回答
  •  粉色の甜心
    2021-01-12 03:54

    I think if statements are better. You can't surround every line of code with a try..catch (well you can but you should not do it). You can surround a block of code with try catch but not every line.

    And exceptions slow things down.

提交回复
热议问题