在写代码实现业务场景的过程中,要不断对代码进行重构,有什么原则啊?还有,在核心代码处要加日志,一般要怎么组织关键字,对于有性能损耗的地方,需要不需要刚开始就日志记录执行时间呢?日志打太多会影响程序的性能的,所以日志也应该不要太多为好的吧。
ringa_lee2017-04-18 09:44:24
The principle is: Refactoring should be considered only when development efficiency or operating efficiency encounters a bottleneck
迷茫2017-04-18 09:44:24
Please learn the setting mode for reconstruction issues
For log issues, it is generally recommended to log in key places. As for too many logs affecting performance, a very simple way is to set a switch:
if (ENABLE_LOG){
log(TAG, something);
}
ENABLE_LOG is set to true in the development version and to false in the release version, so that the log can be used without affecting performance in the official version.