《重構 改善既有代碼的設計》——學習筆記(三)

簡化條件表達式 Decompose Conditional(分解條件表達式) 從if、then、else三個段落中分別提煉出獨立函數html if (date.before(SUMMER_START) || date.after(SUMMER_END)) charge = quantity * _winterRate + _winterServiceCharge; else
相關文章
相關標籤/搜索