?

Log in

No account? Create an account
When you take computer programming classes, they tell you to comment… - Blather, Rinse, Repeat
November 1st, 2007
03:08 pm

[Link]

Previous Entry Share Next Entry
When you take computer programming classes, they tell you to comment your code, so that your coworkers won't have to ask you how your code works.

When you get a programming job, your coworkers ask you how your code works, regardless. Which only serves to prove that writing comments is a waste of time.


Tomorrow: how descriptive variable names could get you fired.

(5 comments | Leave a comment)

Comments
 
[User Picture]
From:sboyko
Date:November 2nd, 2007 01:09 am (UTC)
(Link)
I do comment my code, but the commenting is terse and sparse. There is no need for the "add 1 to i" type of comments. But sometimes you write something that you just KNOW someone is going to stumble across and wonder why the heck you wrote that.

I don't know about descriptive variable names, but one programmer I know got into trouble for the profanity he sprinkled liberally through his code... and debug code... which ended up on-screen during a demo...
[User Picture]
From:tsmaster
Date:November 2nd, 2007 01:19 am (UTC)
(Link)
Yeah, when I take my tongue out of my cheek, of course I advocate intelligent commenting. You're right - "add 1 to i" is actually a hindrance, because it wastes screenspace without adding to my understanding any.

One insightful description of commenting that I heard years ago was that computer programs, and computer languages, are really primarily tools for communicating between humans. The fact that computers can read them is secondary. The target audience that I usually try to reach with my code is myself two or three months down the road - I know I'll forget what I was thinking, so my comments are principally for my own benefit. I could write them in my own made up language, for all the use my coworkers get get from them.

And yet, it sure would be nice if people would actually READ the comments before modifying code. But that's crazy thinking.
[User Picture]
From:sboyko
Date:November 2nd, 2007 02:21 am (UTC)
(Link)
That's an excellent description of commenting.

And yet, it sure would be nice if people would actually READ the comments before modifying code. But that's crazy thinking.

Comments are not in the agile programming bible!
[User Picture]
From:rechercher
Date:November 2nd, 2007 03:55 pm (UTC)
(Link)
And yet, it sure would be nice if people would actually READ the comments before modifying code. But that's crazy thinking.

LOL Like expecting people to use turn signals and other things.
[User Picture]
From:rechercher
Date:November 2nd, 2007 03:54 pm (UTC)
(Link)
one programmer I know got into trouble for the profanity...

that's just too funny
My Website Powered by LiveJournal.com