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

  • 相关阅读:
    Oracle求连续的年份
    关于Extjs MVC模式上传文件的简单方式
    后进先出 stack、 先进先出Queue
    python的文件操作
    C#的接口
    C#的访问级别
    C#的继承
    SQL查询语句 常用示例
    SQL Server数据库常用函数
    数据库建立和连接
  • 原文地址:https://www.cnblogs.com/johnpher/p/2570591.html
Copyright © 2011-2022 走看看