2

两个方法中有相同的部分就会想办法把这些相同的部分独立作为一个新方法,再在原方法中...

 2 years ago
source link: https://www.v2ex.com/t/825828
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.
neoserver,ios ssh client

V2EX  ›  程序员

两个方法中有相同的部分就会想办法把这些相同的部分独立作为一个新方法,再在原方法中调用,浪费了不少时间

  kaiki · 13 小时 33 分钟前 · 549 次点击

每次写东西都会去“优化”这些跑起来根本没问题的地方,经常能优化出问题,然后再修复,有可能最后优化完了还是觉得第一版好用,但是两个方法中有重复代码,就觉得不舒服。 主要是自己的东西,给别人写的能跑起来就行,优化,不存在的。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK