The two most important days in your life are the day you were born and the day you find out why. -Mark Twain

#84 程式設計的簡約格式 - 減少程式碼縮排

最近在 code review 的過程中,總是常常會看到一些令人驚喜的事情,其中一件事情和程式的寫法有關.有時候是邏輯可以在簡化,有時候是 coding style 上可以在簡化以便閱讀.首先來看 coding style 可以簡化的部份.在寫程式的過程中,有時會因為業務邏輯面的複雜而造成會寫出多個 nested if statements 的情況,如下面的例子 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled...
Share: