Click here to Skip to main content
15,891,375 members

Survey Results

Do you have a coding style?   [Edit]

Survey period: 7 May 2012 to 14 May 2012

Do you have a consistent way in which you format code, arrange files, methods, your projects, your comments? Or is it all a little ad lib? Do you have, in short, a Coding Standards Bible that you adhere to?

OptionVotes% 
I work to a strict, fixed coding standard12212.68
I work to a well defined standard that occasionally changes33434.72
I work to a clear style that constantly evolves.35036.38
I sometimes write some of my code against a standard959.88
No standards.616.34



 
GeneralMessage Removed Pin
7-May-12 3:37
professionalN_tro_P7-May-12 3:37 
GeneralStrict coding standard. PinPopular
Prasad_Kulkarni7-May-12 1:38
Prasad_Kulkarni7-May-12 1:38 
GeneralRe: Strict coding standard. Pin
codeBegin9-May-12 21:10
codeBegin9-May-12 21:10 
QuestionHasn't this been debated in the Lounge, Ad nauseam? Pin
Slacker0077-May-12 1:29
professionalSlacker0077-May-12 1:29 
AnswerRe: Hasn't this been debated in the Lounge, Ad nauseam? Pin
Eddy Vluggen8-May-12 8:40
professionalEddy Vluggen8-May-12 8:40 
GeneralNo choice Pin
RedSonja7-May-12 0:20
RedSonja7-May-12 0:20 
GeneralFlexible and Fixed PinPopular
Nagy Vilmos6-May-12 21:57
professionalNagy Vilmos6-May-12 21:57 
GeneralRe: Flexible and Fixed Pin
CDP18027-May-12 1:07
CDP18027-May-12 1:07 
The most important thing is to realize that we are talking about things that have no direct influence on the project's outcome. The compiler does not care very much about code style as long as it is syntactically correct. Readability and standards are important to let a team work on the project efficiently, but not so important that those standards must be enforced at all costs.

My worst experience was a project where somebody went a little overboard by installing a tool similar to Style Cop and setting the strictest style rules and treating all violations as errors. I personally don't like to write code based on assumptions. When the documentation does not help, I simply test my assumptions with a few lines of code and the debugger. Simple enough, at least as long as there is no dumb tool that keeps on complaining about your quick and dirty test until you have not styled and polished everything perfectly. That tool is supposed to assist me, and not to harass me into styling code that I am going to throw away in a few minutes once I have what I wanted to know. Nobody needs an automated clueless smarta$$.

The other thing is to define exactly what 'readable' actually means. My native language is not English and variable names that don't start with a capital letter, like camelCase, always distract me from the code I'm reading. I'm used to all nouns being capitalized and it's a hard habit to break when encountering variable names that don't do that. Readability obviously is a personal thing, and therefore it's futile to try to enforce some supposedly global rules. A team should simply agree on a style that suits its needs, use and adapt it with good will and simply see over occasional violations.
At least artificial intelligence already is superior to natural stupidity



GeneralRe: Flexible and Fixed Pin
Nagy Vilmos7-May-12 1:10
professionalNagy Vilmos7-May-12 1:10 
GeneralStructure = readability, but too strict = less adaptability Pin
Nelek6-May-12 21:07
protectorNelek6-May-12 21:07 
GeneralIt makes me who I am.. Pin
VallarasuS6-May-12 19:46
VallarasuS6-May-12 19:46 
GeneralRe: It makes me who I am.. Pin
Rob Grainger7-May-12 10:23
Rob Grainger7-May-12 10:23 

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.