ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Coding Standards

(1/2) > >>

wraith808:
So... we've been given new coding standards where I work.  I'm ok with that.  But one of the conventions is driving me CRAZY!

Normally, I'd write something like...


--- Code: C# ---private string _propertyX = string.Empty;public string PropertyX{  get { return this._propertyX; }  set { this._propertyX = value; }}
(Yes, I know about auto-implemented properties; this is just an example. ;))

But under the new coding standards, it would look like this.

--- Code: C# ---private string propertyX = string.Empty;public string PropertyX{  get { return this.propertyX; }  set { this.propertyX = value; }}
I have spent *so* much time debugging typing errors now... the _ clearly separated my property store from my property name.  But this... AIEEEEEE!

I just had to vent...  :-[

mouser:
i also cant stand the practice of using _ prefix for internal properties.  i think it's asinine and ugly.

oops -- i see you were the one using _ hahahaahaha :) :) :)

i can't say i love the coding standard you have to use either -- too hard to distinguish.

i've always liked the idea of using lowercase for internal variables, mixed case for exposed stuff.

wraith808:
i can't say i love the coding standard you have to use either -- too hard to distinguish.

i've always liked the idea of using lowercase for internal variables, mixed case for exposed stuff.
-mouser (April 03, 2011, 09:04 AM)
--- End quote ---

Even in that case, don't you have a hard time distinguishing?  And not using any caps in the internal stuff would *really* screw me up... I use CodeRush, and it allows you to navigate the camel caps- saves a lot of time!

And I like the (_) :P :) :)  a lot better than m_, etc at least...  ;D

mouser:
i just cant wrap my mind around a leading _ it always feels to me like something got truncated.

i'm a fan of long variable names, so i'd even prefer using some prefix like i_

alivingspirit:
Wow that is annoying. >:( That is the kind of coding standard that makes me want to scream "Why?!". Usually coding standards are supposed to make code easier to read. This just makes you second guess every variable. Is it a property or no? Do we want to set it using the property store?
I strongly am of the opinion the property stores should only be accessed directly under the most dire of circumstances because of how unclear and unstable it makes the code look. They should therefore be unmistakably different from the rest of the code. I hope they change the standards back to the "_" way. Sounds like your work place is a tough bureaucracy. Good luck getting it back the way it was.

Navigation

[0] Message Index

[#] Next page

Go to full version