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

前端 未结 15 2658
一向
一向 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:34

    Relying on short-circuiting is the "right thing" to do in most cases. It leads to terser code with fewer moving parts. Which generally means easier to maintain. This is especially true in C and C++.

    I would seriously reconsider hiring someone who is not familiar with (and does not know how to use) short-circuiting operations.

提交回复
热议问题