<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Thinking inside a bigger box - Latest Comments in If You Can't Say Anthing Useful...</title><link>http://thinkinginsideabiggerbox.disqus.com/</link><description></description><language>en</language><lastBuildDate>Wed, 15 Mar 2006 12:24:48 -0000</lastBuildDate><item><title>Re: If You Can't Say Anthing Useful...</title><link>http://www.brodwall.com/johannes/blog/2006/02/17/if-you-cant-say-anthing-useful/#comment-1795828</link><description>I just stumbled across another piece of fantastic code comments that I'd love to share. It's from the PHPUnit2 documentation, have a laugh:&lt;br&gt;&lt;br&gt;    protected function setUp() &lt;br&gt;    {&lt;br&gt;        // Create the Array fixture.&lt;br&gt;        $this-&amp;gt;fixture = Array();&lt;br&gt;    }&lt;br&gt; &lt;br&gt;    public function testNewArrayIsEmpty() {&lt;br&gt;        // Assert that the size of the Array fixture is 0.&lt;br&gt;        $this-&amp;gt;assertEquals(0, sizeof($this-&amp;gt;fixture));&lt;br&gt;    }&lt;br&gt; &lt;br&gt;    public function testArrayContainsAnElement() {&lt;br&gt;        // Add an element to the Array fixture.&lt;br&gt;        $this-&amp;gt;fixture[] = 'Element';&lt;br&gt; &lt;br&gt;        // Assert that the size of the Array fixture is 1.&lt;br&gt;        $this-&amp;gt;assertEquals(1, sizeof($this-&amp;gt;fixture));&lt;br&gt;    }</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Marius Mårnes Mathiesen</dc:creator><pubDate>Wed, 15 Mar 2006 12:24:48 -0000</pubDate></item><item><title>Re: If You Can't Say Anthing Useful...</title><link>http://www.brodwall.com/johannes/blog/2006/02/17/if-you-cant-say-anthing-useful/#comment-1795827</link><description>Too shy: just enable automatic code folding for comments in IntelliJ. Then you can unfold if you need a close look.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kjetil</dc:creator><pubDate>Fri, 24 Feb 2006 21:24:44 -0000</pubDate></item><item><title>Re: If You Can't Say Anthing Useful...</title><link>http://www.brodwall.com/johannes/blog/2006/02/17/if-you-cant-say-anthing-useful/#comment-1795826</link><description>For object oriented languages I feel the class header should ALWAYS be commente.&lt;br&gt;&lt;br&gt;_Especially if the classname is a generic one like *HashTable_. &lt;br&gt;&lt;br&gt;One of many nuiances working with legacy code is figuring out in which context(s) classes are used and sometimes the mere purpose of them without reading through the entire class.&lt;br&gt;&lt;br&gt;If you call outside objects methods its useful to briefly tag them with a comment or even a @see doclet.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ole Christian Rynning</dc:creator><pubDate>Wed, 22 Feb 2006 02:48:59 -0000</pubDate></item><item><title>Re: If You Can't Say Anthing Useful...</title><link>http://www.brodwall.com/johannes/blog/2006/02/17/if-you-cant-say-anthing-useful/#comment-1795825</link><description>Obvious comments do suck when you look at the code. However, sometimes (like just before negotiating your salary or vacation plans - or for some other personal or professional reason) you might want to use the javadoc tool to generate fancy and goodlooking API documents to show someone to prove, or create the illusion of, work well done! In this case the tagline "Never, ever, say in comments what the code already says." is not appliable as there is no code to look at, but only the generated API docs! I still agree that comments should not be verbose, but they should be there (even if they are slightly useless and redundant when you have the souce code in front of you). Keep them in dense form though. &lt;br&gt;&lt;br&gt;P.S. Wouldn't it be nice with a "do not show comments"-function in the IDE? Then we could have both clean code and nice API docs at the same time with no annoyance. &lt;br&gt;&lt;br&gt;P.S.S. Almost forgot; writing good code is just as hard as writing good comments. Some programmers are actually better at writing comments than code and in those cases having comments to read before rewriting their uncomprehensible code is nice.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Too shy to say my name.</dc:creator><pubDate>Mon, 20 Feb 2006 19:26:28 -0000</pubDate></item></channel></rss>