Do you consider this technique “BAD”?

前端 未结 28 2052
借酒劲吻你
借酒劲吻你 2021-02-02 10:57

Sometimes you need to skip execution of part of a method under certain non-critical error conditions. You can use exceptions for that, but exceptions generally are not

28条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-02 11:41

    I think I'd have to agree with your colleagues just because of readability, it's not clear atfirst glance what you are trying to accomplish with this code.

    Why not just use

    if(isGood)
    {
    ...Execute more code
    }
    

    ?

提交回复
热议问题