Click here to Skip to main content
11,415,510 members (86,790 online)

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.

OptionVotes% 
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? Pin
d@nish 8-May-14 17:46
member d@nish 8-May-14 17:46 
GeneralRe: How much commenting is actually relevant? Pin
Nagy Vilmos9-May-14 1:01
professionalNagy Vilmos9-May-14 1:01 
GeneralRe: How much commenting is actually relevant? Pin
freedeveloper11-May-14 10:07
professionalfreedeveloper11-May-14 10:07 
Generalmissing option Pin
thrakazog8-May-14 12:55
memberthrakazog8-May-14 12:55 
GeneralRe: missing option Pin
Nelek10-May-14 13:09
memberNelek10-May-14 13:09 
GeneralRe: missing option Pin
thrakazog14-May-14 7:38
memberthrakazog14-May-14 7:38 
GeneralAnd what's so sad is Pin
W Balboos8-May-14 9:02
memberW Balboos8-May-14 9:02 
GeneralWhy vs. What Pin
Marc Clifton8-May-14 6:16
protectorMarc Clifton8-May-14 6:16 
GeneralOne more option : I Use Regions in my code Pin
Rahul VB8-May-14 0:04
professionalRahul VB8-May-14 0:04 
GeneralRe: One more option : I Use Regions in my code Pin
Marc Clifton8-May-14 6:26
protectorMarc Clifton8-May-14 6:26 

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
Web01 | 2.8.150427.4 | Last Updated 10 Aug 2007
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid