KBD

Keith Devens .com

Saturday, September 6, 2008 Flag waving
Premature abstraction is an equally grevious sin as premature optimization. – me
← Entry 1677Entry 1679 →

Daily link icon Wednesday, March 20, 2002

Entry 1678

Via LtU, JavaZone: Why I Don't Read Code Comments, by Dr. Heinz Kabutz. "I don't like comments. They are often so useless that I usually don't read them. Ever since my older brother caught me typing REM statements into a program as a child and then broke the news to me that they did absolutely nothing, I've developed a keen distrust of comments. This opinion only solidified when I pursued my computer science degree. I realized that my classmates and I wrote comments only to earn good marks from mean-spirited instructors who were more concerned with whether our code was commented than whether it worked correctly! Simply put, I felt that comments were a waste of time."

Funny and short article. Obviously we need comments, but the most useful thing he has to tell you is to make your code more descriptive. For instance, if the paramater to getName() was "component_index" instead of "idx", it might have been a little clearer. It was already pretty clear, but that's just an example. Always use long names where it makes sense, and feel free to use underscores_in_your_variable_names. LtU also has a good discussion on comments worth checking out.

← Entry 1677Entry 1679 →

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)
:

September 2008
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
282930 



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

Recent comments XML

new⇒I hate Norton Antivirus

Long long live AVG I love you!...

kevin sands: Sep 6, 7:31pm

new⇒I hate ASP.NET

CF, why pick that piece of trash?​Cold Confusion. Is it finally​really a OO...

ColdConfusion: Sep 5, 8:36pm

Maps of Iraq

This is for Linda, I will be​visiting that site some time in the​near futur...

Bob: Sep 5, 1:20pm

Girls, please don't get breast implants

Well alright I just read my above​comment and I wanted to add​this...I shou...

76.66.140.8: Sep 4, 7:31pm

Spider solitaire

I don't think the question was​necessarily if there are unbeatable​games.  ...

Jared: Sep 4, 12:44pm

Convert Pantone Colors to RGB and Hex - Color Conversion Chart

The colors on those website don't​seem to relate to the pantone data​we hav...

blah: Sep 3, 10:12am

Generated in about 0.327s.

(Used 8 db queries)

mobile phone