Click here to Skip to main content
15,923,557 members

Survey Results

Do you have formal coding guidelines in your company?   [Edit]

Survey period: 29 Aug 2005 to 4 Sep 2005

Do you have guidelines explaining coding standards such as naming conventions, error handling and inline documentation requirements, or is it every man for themselves?

OptionVotes% 
Yes, and they must be adhered to22822.18
Yes, but they are fairly casual29228.40
No, we just try to be consistent with one another31730.84
No19118.58



 
GeneralRe: What code casing style do you follow? Pin
Bob Stanneveld29-Aug-05 4:00
Bob Stanneveld29-Aug-05 4:00 
GeneralRe: What code casing style do you follow? Pin
jhwurmbach29-Aug-05 2:28
jhwurmbach29-Aug-05 2:28 
GeneralRe: What code casing style do you follow? Pin
Bob Stanneveld29-Aug-05 4:02
Bob Stanneveld29-Aug-05 4:02 
GeneralRe: What code casing style do you follow? Pin
tommazzo29-Aug-05 5:18
tommazzo29-Aug-05 5:18 
GeneralRe: What code casing style do you follow? Pin
Joshua Quick29-Aug-05 6:41
Joshua Quick29-Aug-05 6:41 
GeneralRe: What code casing style do you follow? Pin
jonathan1530-Aug-05 4:50
jonathan1530-Aug-05 4:50 
GeneralRe: What code casing style do you follow? Pin
Detlef D. Doerscheln31-Aug-05 1:02
Detlef D. Doerscheln31-Aug-05 1:02 
GeneralRe: What code casing style do you follow? Pin
Synaptrik31-Aug-05 8:32
Synaptrik31-Aug-05 8:32 
I use m_camelCase for members, PascalCase for classes, properties, and methods. In C++ I used the C prefix for classes. Not in C#. I use the I prefix in both languages for interfaces. e prefix for enums to establish that its not a #define. I like the m_ for members as it pushes out the name with the direct association that its a member, and doesn't conflict with a local that is usually being compared to the member. I don't like my, as its two characters the same as m_ but makes me think Hungarian. I used informal Hungarian in C++, but I threw it out in C#. m_ is the only common usage of an underscore. I like it. Wink | ;)

I was a believer in informal hungarian earlier but have moved on. At my last company we had a formal set of guidelines. This current place doesn't, but I'm adhering to my own. I believe strongly in having consistency across the entire code base. It should be intuitive to all members of the team. And when a new person joins, they shouldn't have to learn umpteen coding styles. I like my curly braces on their own line and directly below the start of the block. It allows me to grab the block as a whole with drag n drop. Plus its a direct visual as to what's in the block.

Comments are always welcome. Anything that helps me understand what I was thinking then, or what they were thinking then. The code isn't always intuitive. Sure I can read it and reverse engineer its meaning, but I won't know why immediately most of the time. I'm a lover of comments.

What happens instead if there isn't a consistency followed is what we have here now, as a new person starts, a new branch of standards are introduced and it becomes just a bit unwieldy. Prefixed stored procnames are another one.

In addition I think a generic best practices guideline is also helpful. Logging, data access, NOT using strings for EVERYTHING. Wink | ;) I find this often with ASP developers. Build a search string from the database, and index into it for your keyword instead of putting together a bitflag. But I digress.


This statement is false

Semantic Sense in a Stream of Syntax
Twiddles my Bits from Degree in Form
To Dissipate into Meaning

This statement is false

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.