.NET Coding Guidelines - Commenting(3poundmass.wordpress.com)

submitted by wooyaywooyay(695) 4 years, 9 months ago

Nice rant about developers who don't comment their code, I can sympathize.

8 comments |category: |Views: 10

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by gavinjoycegavinjoyce(25.7k) 4 years, 9 months ago 0

Commenting code is over rated, I much prefer well written code which is self explanatory. If a piece of code needs comments, it may also need a refactor.

Reply

posted by IDelectableIDelectable(290) 4 years, 9 months ago 0

I agree to an extent, I'd usually rather have well designed self-documenting code than awful code that's commented. But, especially with larger and more complex systems, it good to have documentation and comments too, so you can tell what the programmer was trying to do, and why. There's a limit to what you can infer from code alone, no matter how well designed it is.

Reply

posted by gavinjoycegavinjoyce(25.7k) 4 years, 9 months ago 0

That's a fair point. As with pretty much everything else, balance is key.

Reply

posted by dwhittakerdwhittaker(13.1k) 4 years, 9 months ago 0

Commenting for the sake of commenting is poor, however, commenting on the intent is a MUST. Simple easy to read code should not need comments. However, code the is odd/complex or is a 'hack' MUST have comments so the next guy can understand the 'intent/why' of what the code does.

Reply

posted by IDelectableIDelectable(290) 4 years, 9 months ago 0

dwhittaker - I agree, for hacks it's handy to use "HACK" comment, same for "TODO", so they show up in the Visual Studio Task List.

Reply

posted by gt1329agt1329a(7849) 4 years, 9 months ago 0

After seeing a 200k LoC project we outsourced last year come back with 0 comments, I have to agree that it's better to be safe than sorry and require a certain level of commenting. In the end, that project literally got scraped, because even the people who wrote it were unable to maintain it a year later.

Reply

posted by isuttleisuttle(1140) 4 years, 9 months ago 0

I'm sure you'd all agree, but method/property commenting for use with Intellisense is a must in my book.

Reply

posted by wooyaywooyay(695) 4 years, 9 months ago 0

isuttle - definitely, it makes life so much easier when methods have XML comments that show up in IntelliSense. This feature will soon be available for JavaScript too, in Visual Studio 2008.

Reply

information Login or create an account to comment on this story