<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-2234699053314393169.post7747768178513923203..comments</id><updated>2009-11-12T10:26:13.896+02:00</updated><title type='text'>Comments on IT Gears - Serving The Hacker Culture: Why programmers don't want to comment code</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://it-gears.blogspot.com/feeds/7747768178513923203/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default'/><link rel='alternate' type='text/html' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html'/><author><name>Явор Иванов</name><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2234699053314393169.post-914040979932218128</id><published>2007-01-25T06:17:00.000+02:00</published><updated>2007-01-25T06:17:00.000+02:00</updated><title type='text'>It's a good idea to comment our code especially fo...</title><content type='html'>It's a good idea to comment our code especially for crowded functions, even with only several words. Better do it, than to sorry when you're trying to read your last year's code.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/914040979932218128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/914040979932218128'/><link rel='alternate' type='text/html' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html?showComment=1169698620000#c914040979932218128' title=''/><author><name>Angel</name><uri>http://www.blogger.com/profile/01881421358207113133</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html' ref='tag:blogger.com,1999:blog-2234699053314393169.post-7747768178513923203' source='http://www.blogger.com/feeds/2234699053314393169/posts/default/7747768178513923203' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-2234699053314393169.post-7670785098481435388</id><published>2007-01-15T20:29:00.000+02:00</published><updated>2007-01-15T20:29:00.000+02:00</updated><title type='text'>As a few people have mentioned, comments get out o...</title><content type='html'>As a few people have mentioned, comments get out of sync. Clear, well-written tests (preferable written via TDD) make better documentation, because they are forced to stay in sync with the code. As a side benefit, testable code is generally also well-factored and readable. &lt;br /&gt;&lt;br /&gt;You still need comments for one situation: to describe WHY your code does something. If your comments are describing WHAT your code does, you probably have room to extract a well-named method or make a similar enhancement to the readability of your code.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/7670785098481435388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/7670785098481435388'/><link rel='alternate' type='text/html' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html?showComment=1168885740000#c7670785098481435388' title=''/><author><name>Ryan Cooper</name><uri>http://www.blogger.com/profile/08635857155555755249</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html' ref='tag:blogger.com,1999:blog-2234699053314393169.post-7747768178513923203' source='http://www.blogger.com/feeds/2234699053314393169/posts/default/7747768178513923203' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-2234699053314393169.post-594160098608827622</id><published>2007-01-10T19:35:00.000+02:00</published><updated>2007-01-10T19:35:00.000+02:00</updated><title type='text'>Documentation is like sex:

When it's good - it's ...</title><content type='html'>Documentation is like sex:&lt;br /&gt;&lt;br /&gt;When it's good - it's out of this world...&lt;br /&gt;&lt;br /&gt;When it's bad, it's better than nothing...</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/594160098608827622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/594160098608827622'/><link rel='alternate' type='text/html' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html?showComment=1168450500000#c594160098608827622' title=''/><author><name>Steven J. Ackerman</name><uri>http://spaces.msn.com/sjackerman</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html' ref='tag:blogger.com,1999:blog-2234699053314393169.post-7747768178513923203' source='http://www.blogger.com/feeds/2234699053314393169/posts/default/7747768178513923203' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-2234699053314393169.post-2107872195377723989</id><published>2007-01-10T17:04:00.000+02:00</published><updated>2007-01-10T17:04:00.000+02:00</updated><title type='text'>"A true Klingon warrior never comment the source"
...</title><content type='html'>"A true Klingon warrior never comment the source"&lt;br /&gt;&lt;br /&gt;Only seems to be a joke...</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/2107872195377723989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/2107872195377723989'/><link rel='alternate' type='text/html' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html?showComment=1168441440000#c2107872195377723989' title=''/><author><name>Laszlo Baranyai</name><uri>http://www.uni-corvinus.hu/~blaszlo/</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html' ref='tag:blogger.com,1999:blog-2234699053314393169.post-7747768178513923203' source='http://www.blogger.com/feeds/2234699053314393169/posts/default/7747768178513923203' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-2234699053314393169.post-6982357571943614348</id><published>2007-01-10T14:32:00.000+02:00</published><updated>2007-01-10T14:32:00.000+02:00</updated><title type='text'>In an attempt to dispel the "I don't need to comme...</title><content type='html'>In an attempt to dispel the "I don't need to comment my code since if the code is written clearly enough it should describe itself" theory, I present the following:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Definition 1.1&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The purpose of code comments is to present intent.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Definition 1.2&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A software defect is a deviation from intent. This definition does not make a distinction between implicit (i.e. expected but not defined in a requirement) and explicit (i.e. defined in a requirement) intent.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Theorem 1.1&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Code is &lt;i&gt;in&lt;/i&gt;capable of sufficiently presenting desired intent.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Proof&lt;/i&gt;   I will provide an indirect proof of Theorem 1.1 by assuming "code is capable of sufficiently presenting desired intent" and obtaining a contradition. Choose a section of code that contains defects. By Definition 1.2 this section of code does not correctly describe the intent. QED&lt;br /&gt;&lt;br /&gt;Notice that Theorem 1.1 contains the word desired. This is necessary to distinguish between the intent that a section of code with defects presents and the intent that is required. Also notice that Theorem 1.1 contains the word sufficiently. Later entries will expound on this in more depth but for now it will suffice to say that code utilizing crafty programming may obfuscate intent.&lt;br /&gt;&lt;br /&gt;I do acknowledge that for those who use the "I don't need to comment my code since if the code is written clearly enough it should describe itself" to mean "I'm too cool / talented / whatever to comment" or to cover for "I'm too lazy to comment" that my argument will have fallen on deaf ears.&lt;br /&gt;&lt;br /&gt;I have written extensively about comments in my blog at &lt;a href="http://www.realityinteractive.com/rgrzywinski/"&gt;http://www.realityinteractive.com/rgrzywinski/&lt;/a&gt;.  Just search for "comment".</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/6982357571943614348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/6982357571943614348'/><link rel='alternate' type='text/html' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html?showComment=1168432320000#c6982357571943614348' title=''/><author><name>Rob Grzywinski</name><uri>http://www.realityinteractive.com/rgrzywinski/</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html' ref='tag:blogger.com,1999:blog-2234699053314393169.post-7747768178513923203' source='http://www.blogger.com/feeds/2234699053314393169/posts/default/7747768178513923203' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-2234699053314393169.post-167059546965434671</id><published>2007-01-10T09:51:00.000+02:00</published><updated>2007-01-10T09:51:00.000+02:00</updated><title type='text'>I do a lot of code reviews, and from my experience...</title><content type='html'>I do a lot of code reviews, and from my experience elegant code is self documenting - and I always try to refactor the code to make it self-explaining. there are a lot of good tricks to do it: short and focused functions/methods/classes with logical names, using variables in a smaller, focused scope, again naming them to reflect their intention. so the code itself is not a problem if it is written with that in mind. &lt;br /&gt;&lt;br /&gt;I found that introspection and "intelligent code helpers" in java and c#  actually caused people to stop reading comments and documentation in the last few years - they just type in the dot and expect to guess the correct method from the list which IDE offers. &lt;br /&gt;&lt;br /&gt;So, as much as I'm in favor of writing good comments annd API documentation, if the method and parameter names are not self-documenting, there will be a lot of problems. Look at Swing in Java - the threading model is clearly documented in code, on the Net, explained in many books, but one of the biggest complaints about it has it's roots in the misuse of the thread model. &lt;br /&gt;&lt;br /&gt;In short, documentation is good, but if the code is not self-explaining, and if it's easier to misuse the API then to use it correctly, programmers did not do their job.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/167059546965434671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/167059546965434671'/><link rel='alternate' type='text/html' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html?showComment=1168415460000#c167059546965434671' title=''/><author><name>Gojko Adzic</name><uri>http://www.gojko.net</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html' ref='tag:blogger.com,1999:blog-2234699053314393169.post-7747768178513923203' source='http://www.blogger.com/feeds/2234699053314393169/posts/default/7747768178513923203' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-2234699053314393169.post-6224114106528855574</id><published>2007-01-10T09:00:00.000+02:00</published><updated>2007-01-10T09:00:00.000+02:00</updated><title type='text'>"Self documenting code" is a trap. Some people thi...</title><content type='html'>"Self documenting code" is a trap. Some people think that they make the code "self documenting" by omitting comments (which becomes true by doing so) - faulty logic, but mostly caused by a distorted perception what is clear for the original programmer and  what is clear for all programmers.&lt;br /&gt;&lt;br /&gt;Comments are mandatory in two situations: To document an interface (javadoc, etc.) and to document intrinsic behavior that makes the code work. Intrisic behavior is the exploit of side effect are any specific domain knowledge that went into the code.&lt;br /&gt;&lt;br /&gt;A rule of thumb: If the comment is longer than the code, it is either redundant or the code needs rework, trying to be too clever is not smart. Also excessivly long comments might hint that the programmer didn't understand the problem and thus described what the code should do and he didn't manage to implement properly.&lt;br /&gt;&lt;br /&gt;Code-reviews are a good occasion to validate comments, so if there is management so there are code-reviews, thus management cares (inadvertly perhaps)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/6224114106528855574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/6224114106528855574'/><link rel='alternate' type='text/html' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html?showComment=1168412400000#c6224114106528855574' title=''/><author><name>Carsten Saager</name><uri>http://saager.org</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html' ref='tag:blogger.com,1999:blog-2234699053314393169.post-7747768178513923203' source='http://www.blogger.com/feeds/2234699053314393169/posts/default/7747768178513923203' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-2234699053314393169.post-5590419896856865644</id><published>2007-01-10T07:42:00.000+02:00</published><updated>2007-01-10T07:42:00.000+02:00</updated><title type='text'>Like Kirubakaran  said...

Comments on how code wo...</title><content type='html'>Like Kirubakaran  said...&lt;br /&gt;&lt;br /&gt;Comments on how code works gets out of sync with the code.&lt;br /&gt;&lt;br /&gt;Here is the best way imho:&lt;br /&gt;&lt;br /&gt;Put header blocks around functions/classes/methods to explain use, input/output.&lt;br /&gt;&lt;br /&gt;All "comments" then go into the code repository systems on commit/updates.&lt;br /&gt;&lt;br /&gt;And when I say comments I don't mean explaining what the code does (that is clear from reading the code). &lt;br /&gt;&lt;br /&gt;Comments should explain the INTENT of the code, the reason behind it.&lt;br /&gt;&lt;br /&gt;Thus looking at a file's log history one can easily figure out what was the logic behind each change and how to modify or tweak it for the next requirement.&lt;br /&gt;&lt;br /&gt;tribui</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/5590419896856865644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/5590419896856865644'/><link rel='alternate' type='text/html' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html?showComment=1168407720000#c5590419896856865644' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html' ref='tag:blogger.com,1999:blog-2234699053314393169.post-7747768178513923203' source='http://www.blogger.com/feeds/2234699053314393169/posts/default/7747768178513923203' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-2234699053314393169.post-7294991664982353018</id><published>2007-01-10T07:25:00.000+02:00</published><updated>2007-01-10T07:25:00.000+02:00</updated><title type='text'>It's hard to set one rule about commenting that ap...</title><content type='html'>It's hard to set one rule about commenting that applies to all situations. I generally try to write self-documenting code, but I put comments in where I think it would help the reader. Anything that might be perceived by a reader as astonishing or unintuitive I will decorate with a comment. Of course I try desperately to avoid writing clever or unintuitive code, because if the code is as clear as the comment would be, then I don't really need the comment, do I?&lt;br /&gt;&lt;br /&gt;Generally I'll put comments above classes to describe the responsibility of the class, because this helps me think about the single responsibility principle. If I'm using the word "and" a lot in the description of the responsibility, perhaps I should have more than one abstraction.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/7294991664982353018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/7294991664982353018'/><link rel='alternate' type='text/html' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html?showComment=1168406700000#c7294991664982353018' title=''/><author><name>Marc</name><uri>http://www.blogger.com/profile/06675538938449139588</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html' ref='tag:blogger.com,1999:blog-2234699053314393169.post-7747768178513923203' source='http://www.blogger.com/feeds/2234699053314393169/posts/default/7747768178513923203' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-2234699053314393169.post-1816093186911752896</id><published>2007-01-10T04:41:00.000+02:00</published><updated>2007-01-10T04:41:00.000+02:00</updated><title type='text'>Documentation does describe what the author thinks...</title><content type='html'>Documentation does describe what the author thinks the code will do, but more importantly, it describes what he or she wants it to do. This makes it easier to spot where someone made a mistake.&lt;br /&gt;&lt;br /&gt;When setting out to create a class or method, I personally find it useful to comment for everything I intend to do. I then write the code around the comments. Often I just delete them, but in other cases, it serves me well to leave some there.&lt;br /&gt;&lt;br /&gt;Comments are especially useful when working in a framework you had no part in planning or creating. "Why did they use this when they could have used that?" You don't know unless there's a comment there. It doesn't mean the comment is necessarily correct, but at least it gives you a sense of what the author had in mind.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/1816093186911752896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/1816093186911752896'/><link rel='alternate' type='text/html' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html?showComment=1168396860000#c1816093186911752896' title=''/><author><name>Ben</name><uri>http://www.blogger.com/profile/03582344930588600413</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html' ref='tag:blogger.com,1999:blog-2234699053314393169.post-7747768178513923203' source='http://www.blogger.com/feeds/2234699053314393169/posts/default/7747768178513923203' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-2234699053314393169.post-1256147160594130770</id><published>2007-01-09T20:10:00.000+02:00</published><updated>2007-01-09T20:10:00.000+02:00</updated><title type='text'>Yes, good code is it's own documentation. Because ...</title><content type='html'>Yes, good code is it's own documentation. Because I don't document, I take extra care of choosing the right function/variable names, or even rewrite less readable code.&lt;br /&gt;&lt;br /&gt;Documentation obfuscates code, it describes what the author thinks the code will do, and not that what really happens at runtime.&lt;br /&gt;&lt;br /&gt;Only exceptions for documentation:&lt;br /&gt;- Some explanation in front of a function, or on top of a module, on how to use the code.&lt;br /&gt;- When code is intended to look like a bug, like an exploit, bug workaround or some undocumented language feature.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/1256147160594130770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/1256147160594130770'/><link rel='alternate' type='text/html' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html?showComment=1168366200000#c1256147160594130770' title=''/><author><name>Bill</name><uri>http://www.blogger.com/profile/00384972089360507981</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html' ref='tag:blogger.com,1999:blog-2234699053314393169.post-7747768178513923203' source='http://www.blogger.com/feeds/2234699053314393169/posts/default/7747768178513923203' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-2234699053314393169.post-7282843563633326998</id><published>2007-01-09T19:51:00.000+02:00</published><updated>2007-01-09T19:51:00.000+02:00</updated><title type='text'>i don't comment or comment on a very high level co...</title><content type='html'>i don't comment or comment on a very high level coz it is a pain to keep the comment in sync with the code. (ie. code update =&gt; updating comment too).&lt;br /&gt;&lt;br /&gt;worse than 'no comments' wud b 'outdated comments'.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/7282843563633326998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2234699053314393169/7747768178513923203/comments/default/7282843563633326998'/><link rel='alternate' type='text/html' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html?showComment=1168365060000#c7282843563633326998' title=''/><author><name>Kirubakaran</name><uri>http://www.blogger.com/profile/13529221086074675182</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://it-gears.blogspot.com/2007/01/why-programmers-dont-want-to-comment.html' ref='tag:blogger.com,1999:blog-2234699053314393169.post-7747768178513923203' source='http://www.blogger.com/feeds/2234699053314393169/posts/default/7747768178513923203' type='text/html'/></entry></feed>