zoukankan      html  css  js  c++  java
  • 你的代码是否过于复杂?

    你的代码是否过于复杂?
    
    
    译文:
    	如果你的代码中出现了下列的情况,就说明你的代码过于复杂了:
    
    1. 你需要在代码中添加“hack”来使其正常工作。
    2. 其他的开发人员经常问你一些代码块是如何工作的。
    3. 其他的开发人员经常错误使用你的代码,并导致了不少的bug
    4. 有经验的开发人员不能一眼看出你代码的含义。
    5. 你很害怕修改这部分的代码。
    6. 管理层认为需要多人共同维护一个简单的类或者文件。
    7. 很难添加新的特性。
    8. 开发者经常为如何实现这段代码的功能而争论。
    9. 这部分代码经常修改。
    原文:
    

    Here are some clues that tellyou that your code may be too complex:

    • Youhave to add “hacks” to make things keep working.

    • Otherdevelopers keep asking you how some part of the code works.

    • Otherdevelopers keep mis-using your code, and causing bugs.

    • Readinga line of code takes longer than an instant for an experienceddeveloper.

    • Youfeel scared to modify this part of the code.

    • Managementseriously considers hiring more than one developer to work on asingle class or file.

    • It’shard to figure out how to add a feature.

    • Developersoften argue about how things should be implemented in this part ofthe code.

    • People make utterlynonsensical changes to this part of the code very often, which youcatch only during code review, or only after the change has beenchecked in.

    That’s what I can come upwith off the top of my head. What are some others?

    链接:
    http://www.codesimplicity.com/post/clues-to-complexity/#comments

  • 相关阅读:
    Python 文件操作
    Python 操作 sqlite
    Python中的random模块
    Linux系统下的/etc/nsswitch.conf文件
    Python 列表/元组/字典总结
    快斗之翼:python2的print和python3的print()
    田小计划:图解Python深拷贝和浅拷贝
    Python 自省指南
    Python运算符优先级
    tc: 模拟网络异常的工具
  • 原文地址:https://www.cnblogs.com/johnpher/p/2570591.html
Copyright © 2011-2022 走看看