Summary

 < Day Day Up > 



The symptoms of i are:

  • Code that requires redundant comments to make it clear what the code is doing.

  • Code that cannot be easily parsed in one pass similar to reading ordinary language.

  • A name that is not understandable without the surrounding context.

To prevent i:

  • Use auto-completion and code templates available in most major editors to make writing fully understandable names easier.

  • Follow standard naming conventions.

  • Choose names that make the code read closer to everyday language.

To cure the effects of i:

  • Read existing code that you are incorporating into your project to look for names that could be made more understandable.

  • When possible, change names to match the comments until the comments are no longer necessary.



 < Day Day Up > 



Preventative Programming Techniques. Avoid and Correct Common Mistakes
Preventative Programming Techniques: Avoid and Correct Common Mistakes (Charles River Media Programming)
ISBN: 1584502576
EAN: 2147483647
Year: 2002
Pages: 121
Authors: Brian Hawkins

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net