News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matt Frost:
Using Comments
October 16, 2012 @ 09:27:43

Matt Frost has posted a few of this thoughts about effective code commenting and how it can help make your application easier to follow and maintain in the long run.

Code comments are strange things; they can be invaluable or they can make the code they're describing more confusing. They can be necessary, unnecessary, explanatory or muddled and some times they're neither; they just are. [...] Code comments have their place, don't get me wrong; but I don't usually come across good comments.

He talks some about the two cases for comments - when to use them (and do it effectively) and when not to use them (yes, there's a time for this too). He notes that, sometimes, if you feel like you need to comment excessively on your code, you might be doing it wrong - that there's a simpler, more understandable way.

The goal should always be to add value to a codebase, whether than be in the form of code, comments or documentation. Bad comments are just as bad as poorly written code and good comments can take poorly written code and make it more easily understandable.
0 comments voice your opinion now!
code comments opinion recommendation


blog comments powered by Disqus

Similar Posts

NetTuts.com: Refactoring Legacy Code: Part 4 - Our First Unit Tests

Anthony Ferrara: A Followup To An Open Letter To PHP-FIG

Piotr Pasich: ClassManager - You shall not pass

Kevin Schroeder's Blog: How chickens and programming are kind of related

SitePoint PHP Blog: 16 PHP Frameworks To Consider For Your Next Project


Community Events

Don't see your event here?
Let us know!


wordpress series opinion laravel5 laravel version api community list introduction unittest extension language release podcast library interview voicesoftheelephpant php7 framework

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework