Click here to Skip to main content
15,908,254 members

Survey Results

What most improves the readability of source code?   [Edit]

Survey period: 24 Mar 2008 to 31 Mar 2008

Reviewing or even learning someone else's code can be hard work. What's the best way to make code easily approachable for someone else?

OptionVotes% 
Obvious and intuitive names for variables, classes and methods64238.31
Clear and useful comments29417.54
Wise use of Whitespace945.61
Correct Spelling and grammar60.36
Limits on file, class and method sizes281.67
Clear and concise code logic and structure39323.45
The use of common coding patterns and practices1649.79

View optional text answers (58 answers)


 
GeneralFirst half of the above Pin
peterchen26-Mar-08 3:22
peterchen26-Mar-08 3:22 
GeneralThe less code, the more readable Pin
Marc Clifton26-Mar-08 0:38
mvaMarc Clifton26-Mar-08 0:38 
GeneralRe: The less code, the more readable Pin
peterchen26-Mar-08 3:27
peterchen26-Mar-08 3:27 
JokeRe: The less code, the more readable Pin
Pete O'Hanlon27-Mar-08 13:10
mvePete O'Hanlon27-Mar-08 13:10 
GeneralRe: The less code, the more readable Pin
peterchen27-Mar-08 13:42
peterchen27-Mar-08 13:42 
GeneralRe: The less code, the more readable Pin
Deano30-Mar-08 6:29
Deano30-Mar-08 6:29 
GeneralRe: The less code, the more readable Pin
tmacpherson1-Apr-08 7:52
tmacpherson1-Apr-08 7:52 
GeneralAlmost All or None at all. Pin
micmanos25-Mar-08 21:18
micmanos25-Mar-08 21:18 
Having read the posts (almost !!) i'd like to share some points.

Code readability is not based on a single factor but it relies on all of the above mentioned to help the reader understand what the code does and how it does it.

Let's take a Class module for example.

A CLASS should have remarks to explain what it does.
..> The variables and functions (and subs too) should have good and informative names.
....> The names should have informative prefixes to help disnstinguish them.
....> The routine code should be compact, well-structured and small (relativelly).
......> Whitespaces should be used.
........> Brief inline remarks should at least inform the reader of what's going on.
........> Execution, calls, logic should be commonly used without any backdoors, workarounds, or "my own cooking recepies" type of thinking.

All these rules are a MUST when there are more than ones self working on code. Of course, if your not programming for open-source (not necessarily GPL Laugh | :laugh: ) or working solo, then all the above are optional. Wink | ;)
GeneralRe: Almost All or None at all. Pin
Corporal Agarn26-Mar-08 1:45
professionalCorporal Agarn26-Mar-08 1:45 
GeneralWhitespace as a partial answer Pin
firegryphon25-Mar-08 7:35
firegryphon25-Mar-08 7:35 
GeneralRe: Whitespace as a partial answer Pin
dawn_31927-Mar-08 6:17
dawn_31927-Mar-08 6:17 
GeneralRe: Whitespace as a partial answer Pin
eggsovereasy28-Mar-08 4:30
eggsovereasy28-Mar-08 4:30 
GeneralCommon coding practices Pin
Gary Wheeler25-Mar-08 7:31
Gary Wheeler25-Mar-08 7:31 
GeneralRe: Common coding practices Pin
izmoto27-Mar-08 3:45
izmoto27-Mar-08 3:45 
GeneralRe: Common coding practices Pin
tmacpherson1-Apr-08 7:57
tmacpherson1-Apr-08 7:57 
GeneralDefinitely, intuitive naming Pin
Vikram A Punathambekar25-Mar-08 6:08
Vikram A Punathambekar25-Mar-08 6:08 
GeneralRe: Definitely, intuitive naming Pin
Vasudevan Deepak Kumar25-Mar-08 19:11
Vasudevan Deepak Kumar25-Mar-08 19:11 
GeneralRe: Definitely, intuitive naming Pin
Tom126-Mar-08 7:39
Tom126-Mar-08 7:39 
GeneralRe: Definitely, intuitive naming Pin
wout de zeeuw28-Mar-08 9:00
wout de zeeuw28-Mar-08 9:00 
GeneralLooks like the top four are eqweighted and people just click the top one coz its easy Pin
quakeboy25-Mar-08 2:12
quakeboy25-Mar-08 2:12 
GeneralRe: Looks like the top four are eqweighted and people just click the top one coz its easy Pin
Simon Capewell25-Mar-08 3:56
Simon Capewell25-Mar-08 3:56 
GeneralRe: Looks like the top four are eqweighted and people just click the top one coz its easy Pin
PIEBALDconsult25-Mar-08 4:19
mvePIEBALDconsult25-Mar-08 4:19 
GeneralRe: Looks like the top four are eqweighted and people just click the top one coz its easy Pin
Erik Midtskogen25-Mar-08 4:52
Erik Midtskogen25-Mar-08 4:52 
GeneralRemember, it's *MOST* improves... Pin
Lebear-0125-Mar-08 2:00
Lebear-0125-Mar-08 2:00 
GeneralTo many options Pin
Mohm'ed Melhem25-Mar-08 0:16
professionalMohm'ed Melhem25-Mar-08 0:16 

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.