Follow treslines by email clicking Here!

Monday, August 1, 2011

How to write less comments without looging context in your app?

How to write less comments (DRY-Principle) ?
(Clean Code Quality Seal : Red)
Table of contents
How can i write less comments witout loosing context in my app?
Do you want to see some examples?
Source code convention tools
Literature, good books and references
How can i subscribe/feed this blog ?
How can i rate this blog ?
Where do i find more clean code knowledge and gadgets?

How can i write less comments without loosing context in my app?

Hi There! In this blog i wanna show you that agility has nothing to do with "no comments". The most developers i know missunderstand the meaning of agile concepts, Xtrem-Programming and other agile concepts associating it automatically with no comments. Applications totally without comments works exactly as long as the code owner works in your company. In fact we can associate agility with LESS, reusable, concise comments. Here some ideas how to write agile comments making your code readable, understandable and reusable. Share this blog with your collegues doing know-how exchange.

How can i write readable, understandable comments?well to do that, we must understand how to comment in the different situations we have in our code. For this reason i have established some comment rules for myself:
  • private variables should comment itself (here you don't need more comments then that)
  • private methods should comment itself (here you don't need more comments then that)
  • public static variables should be commented inline over annotations (if possible and reusable)
  • static methods should be commented inline over annotations (if possible and reusable)
  • public methods should be commented over interfaces
  • private classes should comment itself (here you don't need more comments then that)
  • public static classes should be commented inline over annotations (if possible and reusable)
  • public classes should be commented inline over annotations (if possible and reusable)
  • Interfaces should be commented normaly
  • private constructors should be commented over annotations (@singletonPattern...)
  • public constructors should be commented over annotations (if possible and reusable)

Do you want to see some examples?

See "how to write good, reusable comments" - Link

How could we improve the quality of this article ?

If the content of this article does not help you, so please tell us how to improve the quality of it by giving your contructive feedbacks at the end of this blog. If it was useful to you giving and resuming to you the most important aspects of the subject treated, saving you a lot of time, then help us to maintain this blog with a little appreciation. With a small amount of your choice you help us to cover the prime costs like:


Hosting, autors’s research work, editorial work, blog quality, motivation to make things better than others resulting in a very useful information pool for you and a lot of other developers.

Important : If you do not have the possibility to donate a little amount, than recommend this page to your friends. Thanks !





Source code convention tools

Literature, good books and references

How can i subscribe/feed this blog ?

Subscribe to: Post Comments (Atom)

How can i rate this blog ?

Press google+1 once !

Where do i find more clean code knowledge and gadgets?

No comments:

Post a Comment