KBD

Keith Devens .com

Saturday, July 5, 2008 Flag waving
There is a rank due to the United States, among nations, which will be withheld, if not absolutely lost, by... – George Washington
← Entry 1541Entry 1543 →

Daily link icon Sunday, March 3, 2002

Entry 1542

Via LtU, Embedded.com: Comments on Comments.

Even if you're stuck in a hermetically sealed cubicle never interacting with people and just cranking code all day, I contend that you still have a responsibility to communicate clearly with others. Software is, after all, a mix of computerese (the C or C++ itself) and comments (a verbal description meant for humans, not the computer). If we write perfect C with illegible comments, we're doing a lousy job.</blockquote><blockquote>I think the XP folks got it right by deriving the process from values rather than from a collection of good ideas. However, I'd add a fifth to their list: Pride of Workmanship. In my experience, software created without pride is awful.

My standard for commenting is that someone versed in the functionality of the product, but not the software, should be able to follow the program flow by reading the comments without reference to the code itself. Code implements an algorithm; the comments communicate the code's operation to yourself and others, maybe even to a future version of yourself performing maintenance years from now.

Finally, consider changing the way you write a function. I have learned to write all of the comments first, including the header and those buried in the code. Then it's simple, even trivial, to fill in the C or C++. Any idiot can write software following a decent design; inventing the design, reflected in well-written comments, is the really creative part of our jobs.

← Entry 1541Entry 1543 →

Comments XML gif


Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

July 2008
SunMonTueWedThuFriSat
 12345
6789101112
13141516171819
20212223242526
2728293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 5 posts

Recent comments XML

Girls, please don't get breast implants

> And no, you will not be receiving​a picture.

:-(...

Keith: Jul 2, 6:05am

Javascript clone function

This is a clever way to clone an​object if you are using YAHOO UI.​Same tec...

Antonio: Jul 1, 12:47pm

I hate Norton Antivirus

Oh just one other thing norton is​great at keeping people out of your​compu...

kevin.sands: Jul 1, 12:50am

Terminator 3 was awful

I think the biggest reason why T3​totally blew was because Edward​Furlong g...

76.167.172.64: Jun 29, 3:06am

Generated in about 0.112s.

(Used 8 db queries)

mobile phone