Sunday, September 30, 2012

Coding practice - Keep things simple


  • Good readability - Minimize the time it takes for people who understand your code.
  • Easy to maintenance
  • Easy to understand
  • Learn from open sources, for free!  (Rails gem is a good source for Ruby developers.)
  • No matter how complex a system be, each module and building block can be kept as simple as possible.
  • Each object response for a simple functionality.  
  • Each single function can be unit tested.
  • Keep method size as short as possible.  Say, 5~10 lines.
  • Beautiful code comes from simplicity.
  • DRY - Don't repeat yourself.
  • Do NOT repeat any single business logic on different methods.
  • Before adding a new method or logic, check whether its already implemented in the system.  Reuse or create a wrapping function base on it.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.