Search This Blog

Friday, 11 August 2017

Bad Smells in Code

  • Duplicate code If you see the same code structure in more than one place.

  • Long Method The longer a procedure is, the more difficult it is to understand.

  • Large Class When a class is trying to do too much.

  • Long Parameter List Don't pass in everything the method needs; instead you pass enough so that the method can get to everything it needs.

  • Divergent Change When one class is commonly changed in different ways for different reasons. (You likely have a situation in which two objects are better than one.)

Heads up! When you feel the need to write a comment, first try to refactor the code .so that any comment becomes superfluous.

1 comment:

Elasticsearch - Nodes, clusters, and shards

Elastic Stack Video - Load your gun in short time.   Beginner's Crash Course to Ela...

Recent Post