Click here to Skip to main content

Survey Results

Do you comment your code?

Survey period: 5 May 2014 to 12 May 2014

A repeat of our survey from 4 years ago. Let's see how things have changed.

I add comment headers for all public classes, objects and methods, events, fields etc56740.04567 votes, 40.04%
I add comment headers for all non-public classes, objects and methods, as well as non-obvious logic inside these37226.27372 votes, 26.27%
I provide comments at the top of files29921.12299 votes, 21.12%
I comment any code that may be obscure (the "what") to a reader88162.22881 votes, 62.22%
I comment any code where the purpose (the "why") may be obscure93966.31939 votes, 66.31%
I comment on expected inputs, outputs and other results27719.56277 votes, 19.56%
I comment on exceptions, side effects or error codes31222.03312 votes, 22.03%
I comment on structures (loop endings, function endings etc)16911.94169 votes, 11.94%
I comment as a last resort when I can't make my code any clearer36325.64363 votes, 25.64%
I do not comment code.896.2989 votes, 6.29%
Respondents were allowed to choose more than one answer; totals may not add up to 100%

GeneralHow much commenting is actually relevant? Pinmember d@nish 8-May-14 17:46 
GeneralRe: How much commenting is actually relevant? PinprofessionalNagy Vilmos9-May-14 1:01 
GeneralRe: How much commenting is actually relevant? Pinprofessionalfreedeveloper11-May-14 10:07 
Generalmissing option Pinmemberthrakazog8-May-14 12:55 
GeneralRe: missing option PinmemberNelek10-May-14 13:09 
GeneralRe: missing option Pinmemberthrakazog14-May-14 7:38 
GeneralAnd what's so sad is PinmemberW Balboos8-May-14 9:02 
GeneralWhy vs. What PinprotectorMarc Clifton8-May-14 6:16 
GeneralOne more option : I Use Regions in my code PinprofessionalRahul VB8-May-14 0:04 
GeneralRe: One more option : I Use Regions in my code PinprotectorMarc Clifton8-May-14 6:26 
GeneralA missing choice Pinmemberaboubkr907-May-14 18:20 
GeneralRe: A missing choice PinprofessionalVedat Ozan Oner8-May-14 3:27 
GeneralRe: A missing choice Pinprofessional_Maxxx_11-May-14 2:00 
GeneralDan Saks, one-time secretary of the ANSI C and C++ committees, said it best PinmemberGary R. Wheeler6-May-14 14:36 
GeneralMy Philosophy PinmemberPualee6-May-14 5:39 
GeneralRe: My Philosophy PinmemberGary R. Wheeler6-May-14 14:37 
GeneralComment for Understanding Pinmembershub.goel6-May-14 2:47 
GeneralDifficult to find a fit on the options. PinprotectorDaveAuld5-May-14 22:01 
GeneralI comment code when i don't need it any more PinprofessionalAnurag Gandhi5-May-14 19:42 
GeneralPosting Articles in CodeProjec Improves My Commenting PinmemberRavimal Bandara5-May-14 18:55 
GeneralThe Only Times I Comment PinmemberJoe Gakenheimer5-May-14 12:57 
AnswerI comment on questions regarding code commenting PinmemberMacSpudster5-May-14 12:29 
GeneralInitial and date comments Pinprofessional_Damian S_5-May-14 12:14 
GeneralRe: Initial and date comments PinmemberGary R. Wheeler6-May-14 14:41 
GeneralRe: Initial and date comments Pinprofessional_Damian S_6-May-14 14:52 
GeneralRe: Initial and date comments Pinprofessional_Maxxx_11-May-14 2:01 
GeneralDoxyGen compliant PinmemberMike Hankey5-May-14 11:59 
GeneralWhat About.... Pinmemberledtech35-May-14 9:08 
GeneralPer the tale of two developers... PinprofessionalDuncan Edwards Jones5-May-14 8:10 
AnswerThe Ninja coder PinprofessionalRavi Bhavnani5-May-14 6:45 
GeneralRe: The Ninja coder Pinprotectorthatraja5-May-14 7:00 
Generaltry to code... PinmemberDennis E White5-May-14 5:23 
GeneralCaptain obvious comments Pinmembered welch5-May-14 0:54 
GeneralRe: Captain obvious comments PinmvpRyanDev5-May-14 2:10 
GeneralRe: Captain obvious comments PinmemberJahmal235-May-14 5:54 
GeneralRe: Captain obvious comments PinprofessionalDJ van Wyk5-May-14 20:39 
GeneralRe: Captain obvious comments PinmemberPualee5-May-14 6:05 
GeneralRe: Captain obvious comments Pinprotectorthatraja5-May-14 6:58 
GeneralRe: Captain obvious comments PinmemberNemanja Trifunovic5-May-14 9:35 
GeneralRe: Captain obvious comments PinprofessionalDennis_E6-May-14 22:58 
GeneralRe: Captain obvious comments Pinmemberaboubkr907-May-14 18:41 
GeneralGive credit where due PinmemberMember 90635565-May-14 0:52 
General"Sometimes".... Pinmemberimagiro4-May-14 23:29 
GeneralDepends on who will use my code Pinmemberzaxthealien4-May-14 22:02 
GeneralLast resort... PinprofessionalSander Rossel4-May-14 22:02 
GeneralClasses and methods when necessary, everything else shouldn't need any comments. PinprofessionalAlexCode4-May-14 21:53 
Generaladd one more option PinprofessionalMarla Sukesh4-May-14 21:42 
GeneralI try... PinmemberJim Meadors4-May-14 20:16 
GeneralRe: I try... and regret not succeeding PinmemberErik Rude5-May-14 23:41 
General"Why" is really important than "What"...! Pinmemberkoolprasad20034-May-14 20:04 

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

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

Advertise | Privacy | Mobile
Web03 | 2.8.150327.1 | Last Updated 10 Aug 2007
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid