是这样的,今天和一白人男讨论他的西皮皮代码 (C++ code)

来源: 2010-10-21 11:16:30 [旧帖] [给我悄悄话] 本文已被阅读:

我问他为啥用 " null != x "?

he said he uses  null == x in if statements becase it is easy to mistakenly write if ( x = null ) instead of  if ( x == null ), both compile; However, null = x does not compile

and to be consistent, he use   null != x

我心想: K, 这多ugly啊,你要能记住每次都倒过来,为啥记不住 x equal equal null?