16

Java编程细节-重构-为什么 if-else 不是好代码

 5 years ago
source link: https://juejin.im/post/5b893eaef265da434816006c
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
平时开发中if-else用的多吗?其实这是个再正常不过的coding习惯,当我们代码量小的时候用来做条件判断是再简单不过的了。但对于优秀程序员来说,这并不是好代码,为啥?抛开剂量谈毒性都是耍流氓在使用条件判断语句的地方,如果代码量小,需要判断的场景少的话,那么

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK