[闲聊] Coding Stye (if)

楼主: Wardyal (Wardyal)   2025-09-26 16:55:03
据说
用 if (1 == test_function())
会比用 if (test_function() == 1)
还有好
因为这样在编译的时候好像就可以帮你抓出啥错的
不过我 code 已经长成第二种了
所以 下次再说
作者: nh60211as   2025-09-26 16:56:00
没差多少了,静态分析也能抓这种
楼主: Wardyal (Wardyal)   2025-09-26 16:57:00
好8 那没事了
作者: SecondRun (雨夜琴声)   2025-09-26 17:47:00
以前还会把false写前面

Links booklink

Contact Us: admin [ a t ] ucptt.com