2013年10月15日 星期二

Communicate your intentions through your code


Book: Implementation Patterns: Kent Beck



很棒的書,特別是寫了幾年的爛東西後,看這個特別有感覺。

  • Programs are read more often than they are written.
  • There is no such thing as “done”.  Much more investment will be spent modifying programs than developing them initially.
  • They are structured using a basic set of state and control flow concepts.
  • Readers need to understand programs in detail and in concept.  Sometimes they move from detail to concept, sometimes from concept to detail.

Using patterns helps programmers write reasonable solutions to common problems, leaving more time, energy, and creativity to apply to the truly unique problems.


Three values that are consistent with excellence in programming are
  • Communication
  • Simplicity
  • Flexibility

The implementation patterns aren’t the way they are “just because”. Each one expresses one or more of the values of communication, simplicity, and flexibility.  Principles are another level of general ideas, more specific to programming than the values, that also form the foundation of the patterns.


Several principles:
  • Local Consequences
  • Minimize Repetition
  • Logic and Data Together
  • Symmetry
  • Declarative Expression
  • Rate of Change



沒有留言:

張貼留言