I don't like this… Is this cheating the language?

前端 未结 15 2667
一向
一向 2021-02-13 15:52

I have seen something like the following a couple times... and I hate it. Is this basically \'cheating\' the language? Or.. would you consider this to be \'ok\' because the IsNu

15条回答
  •  终归单人心
    2021-02-13 16:32

    There is nothing wrong with this, as you just want to make certain you won't get a nullpointer exception.

    I think it is reasonable to do.

    With Extensions you can make it cleaner, but the basic concept would still be valid.

提交回复
热议问题