• 你的代码是否过于复杂?


    你的代码是否过于复杂?
    
    
    译文:
    	如果你的代码中出现了下列的情况,就说明你的代码过于复杂了:
    
    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

  • 相关阅读:
    应用运筹学基础:组合优化 (6)
    应用运筹学基础:组合优化 (5)
    应用运筹学基础:组合优化 (4)
    应用运筹学基础:组合优化 (3)
    应用运筹学基础:组合优化 (2)
    应用运筹学基础:组合优化 (1)
    应用运筹学基础:线性规划 (5)
    The method of type must override a superclass method报错解决方式
    Json文件出现 Expected value at 1:0 问题的解决方法
    浅析XML和JSON的区别
  • 原文地址:https://www.cnblogs.com/johnpher/p/2570591.html
Copyright © 2020-2023  润新知