Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

461 Neutral

About tim_shea

  • Rank
  1. tim_shea

    The Importance of Commenting Your Code

    [quote name='Ghosrath' timestamp='1338469974'] I can suggest a very interesting piece of reading material. Clean code by Robert C. Martin. Especially chapter 4 on comments is great reading material [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Basically it states that every comment placed in code means that the code that is commented is actually bad code. Good code never needs any comments at all! Try this and notice how much easier you can find certain pieces of code, just because you don't need to read through all the comments A little quote: Quote Nothing can be quite so helpfull as a well-placed comment. Nothing can clutter up a module more than frivolous dogmatic comments. Nothing can be quite so damaging as an old crufty comment that propagates lies and misinformation. [/quote] Clean Code is an excellent book. Probably not for beginners, but once you've been coding long enough to groan when you look at your own code, it will help you see how not to. In particular, the concept of self documenting code (and unit tests as documentation) have done wonders for my style. If you can read each line of code aloud without feeling foolish you will almost never need to write a comment.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!