Click here to Skip to main content
15,919,028 members

Survey Results

How do you comment your C# code?   [Edit]

Survey period: 13 Oct 2003 to 19 Oct 2003

C# devs get the new look XML style comments, but do you use them? (suggested by Rakesh Rajan)

OptionVotes% 
Using the /// XML documentation format where appropriate39538.69
Always using the old // or /* format46245.25
Comments? We're meant to comment our code?16416.06



 
GeneralAnother form of comments Pin
leppie13-Oct-03 7:08
leppie13-Oct-03 7:08 
GeneralXML is great but... Pin
Rakesh Rajan13-Oct-03 6:55
Rakesh Rajan13-Oct-03 6:55 
GeneralRe: XML is great but... Pin
kaschimer13-Oct-03 8:56
kaschimer13-Oct-03 8:56 
GeneralRe: XML is great but... Pin
WillemM15-Oct-03 19:53
WillemM15-Oct-03 19:53 
GeneralRe: XML is great but... Pin
bjoernen15-Oct-03 21:42
bjoernen15-Oct-03 21:42 
GeneralRe: XML is great but... Pin
Anonymous16-Oct-03 19:05
Anonymous16-Oct-03 19:05 
GeneralRe: XML is great but... Pin
Gavin Gregson15-Oct-03 22:11
Gavin Gregson15-Oct-03 22:11 
General#3 shouldn't even be an issue! Pin
Heath Stewart13-Oct-03 3:48
protectorHeath Stewart13-Oct-03 3:48 
Seriously, #3 shouldn't be an issue since everyone should be commenting their code! I mean, throwing some one-time use script or app together is one thing, but if you're doing anything that you or others must maintain in the future, comments are a necessity! I know some people subscribe to the "my code is self-describing" idea, or even the "the code should be enough" idea, but how many people - especially in this day and age of "earn more money! get a job in computers!" code monkeys?

As far as code being "self-describing", the only code I've seen do that has variable names 20 characters or more long! Who wants to type that and waste line space for a stupid var?

For the "the code should be could enough" myth, peope like that forget that everyone has their own way of doing things (especially when it comes to coding styles). It may be good enough for you, but someone may be left scratching their head over why you did it that way. Even veteran programmers find it nice to read a comment (as grammatically incorrect as too many developers are these days) than several lines of code. It's easier to get an idea of the code that way. That's especially handy when you're trying to track down a bug in legacy source code.

Where I work, I'm one of the few people who comments code (mostly using the C# documentation syntax, as well as internal documentation). I force my developers to do so, too. The Industrial Engineers, however, (who are entry-level at best) never write comments and are always hacking code in the most inefficient manner, if it's even the right code. The reason (besides sucking)? They can't remember what the methods do or that they already did it!

I used to maintain documentation for our whole suite (it's big!) using NDoc and my own CHM->Help2 conversion program, but it was pointless because they didn't comment their code (the majority of the front-end UI and SQL scripts) and they didn't bother to read it (so instead bugged me incesently about what "X" does instead of RTFD).

There's just no excuse for this. At least add documentation for classes, methods, properties, etc. If not in the C# doc syntax, then in doxygen syntax or whatever you use. Generating documentation from source these days is trivial so there's just no excuse for not doing that.

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRe: #3 shouldn't even be an issue! Pin
J. Dunlap13-Oct-03 18:44
J. Dunlap13-Oct-03 18:44 
GeneralRe: #3 shouldn't even be an issue! Pin
peterchen14-Oct-03 12:54
peterchen14-Oct-03 12:54 
GeneralI use Pin
Tomas Petricek13-Oct-03 1:50
Tomas Petricek13-Oct-03 1:50 
GeneralRe: I use Pin
Rakesh Rajan13-Oct-03 6:54
Rakesh Rajan13-Oct-03 6:54 
GeneralRe: I use Pin
Tomas Petricek13-Oct-03 7:06
Tomas Petricek13-Oct-03 7:06 
GeneralI use both Pin
Andrew Torrance13-Oct-03 1:06
Andrew Torrance13-Oct-03 1:06 
General/// - doxygen style Pin
peterchen12-Oct-03 23:39
peterchen12-Oct-03 23:39 
GeneralRe: /// - doxygen style Pin
Paul Watson13-Oct-03 0:48
sitebuilderPaul Watson13-Oct-03 0:48 
GeneralRe: /// - doxygen style Pin
peterchen13-Oct-03 1:38
peterchen13-Oct-03 1:38 
GeneralRe: /// - doxygen style Pin
Paul Watson13-Oct-03 1:42
sitebuilderPaul Watson13-Oct-03 1:42 
GeneralRe: /// - doxygen style Pin
peterchen13-Oct-03 1:46
peterchen13-Oct-03 1:46 
GeneralRe: /// - doxygen style Pin
Frode N. Rosand14-Oct-03 21:13
Frode N. Rosand14-Oct-03 21:13 
GeneralRe: /// - doxygen style Pin
Matthew Adams14-Oct-03 21:36
professionalMatthew Adams14-Oct-03 21:36 
GeneralRe: /// - doxygen style Pin
Heath Stewart13-Oct-03 3:50
protectorHeath Stewart13-Oct-03 3:50 
GeneralRe: /// - doxygen style Pin
Rakesh Rajan13-Oct-03 6:52
Rakesh Rajan13-Oct-03 6:52 
GeneralRe: /// - doxygen style Pin
Anonymous13-Oct-03 9:34
Anonymous13-Oct-03 9:34 
GeneralRe: /// - doxygen style Pin
Noah Duke14-Oct-03 7:41
Noah Duke14-Oct-03 7:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.