Hands-On Software Engineering with Python
上QQ阅读APP看书,第一时间看更新

Standards for code

Code level standards, at the end of the day, are as much about trying to ensure that the code itself is written and structured in a predictable and easily understood manner as anything else. When those standards are followed, and when they are reasonably well understood by the developers who are working with the code base, it's not unreasonable to expect that any developer, even one who may never have seen a given chunk of code, will nevertheless be able to do the following:

  • Read and more easily understand the code and what it's doing 
  • Find a code element (a class, function, constant, or some other item) that may only be identified by name, or in terms of a namespace, quickly and easily
  • Create new code elements in an existing structure that also conform to those standards
  • Modify existing code elements and know what standards-related items need to be modified in concert with those changes (if any)

The Python community has one set of guidelines (PEP-8), but there may well be additional internal standards that are in place as well.