KB Articles Title: Delphi Prism Member Property (property..read..write)
By: Mike Prestwood
[View/Review Post]
 

!!! Anonymous Post !!!

You are not signed in!

You can post an anonymous entry (enter security key below)...

Or, if you are a member, Sign In.

Or, you can Create a Free account now to join our community.


Your Name:
Today's security key = P95A
Enter key:
Add a Comment

Comments

Oldest To Newest

Reader...
Prestwood IT Solutions
Staff
Moderator
Mike Prestwood
Rank: Fleet Admiral

Joined: Oct 2000
Location: Citrus Heights, CA USA
Mike Prestwood -Collapse +Expand
Email Approved! E CA USA
Comment 1 of 2
Friday, July 09, 2010

FWIW, good points. Nothing wrong with standards. I'll sweep thru and update all these examples. For what it's worth, I agree that private and protected probably could both be camel capped.


Reader...
mtiede
Rank: Cadet 3rd Year

Joined: May 2009
Location: Grand Island, NY USA
mtiede -Collapse +Expand
Email Approved! E NY USA

Member Points: 36
Visits: 19
MB Posts: 1

KB Articles: 0
Comment 2 of 2
Friday, July 09, 2010

Although I don't think Microsoft makes it indisputably clear, this link:

http://msdn.microsoft.com/en-us/library/x2dbyw72%28VS.71%29.aspx?ppud=4

Says that Properties should be Pascal Case and Protected (non-public?) instance fields should be Camel Case.

So I think in your example, CyborgName should be Pascal, as it is, but the backing field should be fcName or Camel Case.

Admittedly, they DON'T specifically say what to do with PRIVATE instance fields so that muddies the waters.  But if the backing fields are Pascal and properties are Pascal, then it gets harder to read the code and tell which is which.

Of course, personally, I think having case sensitivity in a language is dumb and the same thing goes for these kinds of "case conventions".

However, I believe that camel case for the (non-public) fields is the recommendation.

FWIW.