News Feed
Sections




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

Anthony Ferrara's Blog:
To Comment Or Not To Comment - A Tale Of Two Stories
June 08, 2012 @ 11:02:20

In this recent post to his blog Anthony Ferrara looks at commenting in your application's code and how to be effective (and not so effective) when using them.

A few weeks ago I was sparked into a twitter conversation with Larry Garfield (@Crell) about the value of comments in code. [...] A pretty innocuous comment [about code that doesn't have comments] that is quite insightful. [...] That led to an interesting discussion that just couldn't fit on twitter. So let me explain...

He defines what he means by "comments" (DocBlock, general comments and legal information) and what sort of things should be inside of them. He also points out a few things not to do in you comments including being overly descriptive and restating what the code is doing (they should be less about that and more about the "Why"). Of course, there's exceptions and he touches on those briefly to finish out the post.

0 comments voice your opinion now!
comment code opinion useful


blog comments powered by Disqus

Similar Posts

Joshua Thijssen: PHP Phragmentation

Jani Hartikainen's Blog: Now you can write PHP code...without writing any code

Chris Roane's Blog: PHP Programmers: Stop Whining and Shut-up!

Patrick Allaert's Blog: Coding standards: converts PHP4 style constructors to PHP5 one

PHPClasses.org: 4 Reasons Why All PHP Frameworks Suck?


Community Events





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


opinion community symfony interview deployment series release tips zendserver unittest update introduction library api laravel framework language package podcast install

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