Dec
01

By: Adam Sroka
12/1/09 5:33 pm UTC
Topic: No Tags

We already know that good unit tests are on FIRE. Here are some characteristics of good code:

Small – Classes contain only a few methods. Methods are no more than a few lines. Together they fit nicely on your screen without scrolling.

Intentional – Every bit of your code reveals precisely why it is there and what you intend for it to do.

Singular – Classes have one responsibility. Methods do one thing.

Tested – Every piece of interesting behavior in your code has a corresponding test (Likely it was written first.)

Encapsulated – Modules don’t know what information other modules contain. They tell instead of asking. They talk only to their closest collaborators.

Refactored – Eventually, code has to change. Good code stays good when it changes because it’s author loves it.

(1)Comment
Comments:
1 Comment posted on "Respect your code like a SISTER"
Fabrice Aimetti on December 6th, 2009 at 4:31 am

Thank you for this post Adam. I’ve translated it in french : Respectez votre code comme une SISTER
Rgeards, Fabice


Post a comment
Name: 
Email: 
URL: 
Comments: