Views: 132.1K
Replies: 5
Archived
|
camelCase - PascalCase vs. CamelCase - pascalCaseThe article on c# coding standards in the reference section of dofactory states:
do use CamelCasing for class names and method names. do use pascalCasing for method arguments and local variables. I believe it should read: do use PascalCasing for class names and method names. do use camelCasing for method arguments and local variables. Kind regards, Dirk. Dirk Andries, Jul 31, 2010
You are right but still for private methods we should go for camalCasing only the public methods can have PascalCasing.
Sathik
Aug 25, 2010
Dirk, you are rite.
Aug 01, 2010
Ya you are absolutely right, when i first read your 2nd and 3rd line i was confused and in my mind same thing arose that you have written in 5th and 6th line.
Aug 01, 2010
|
|
Reply 1We have been knowing all the things about the choices game cheats and we are ready to get the diamonds here for the game.
Jenny Sabir, Jan 09, 2018
|
|
Reply 2Sakubar:
With all due respect, this is not a convention in C#. All methods in C# are PascalCased. Dan McMillan, Aug 25, 2010
|
|
Reply 3You are right, but for
1) private methods we should go for camelCasing, and 2) only public methods can have PascalCasing Sakubar Sathik Khan, Aug 25, 2010
|
|
Reply 4Good catch guys! This was a test of course and you all passed :-)
Anyhow, the page has been corrected. Dan McMillan, Aug 02, 2010
|
|
Reply 5Funny... I am just now reviewing code of some colleagues who regularily seem to start member variables with upper case characters, what they shouldn't. ;-) I wanted to let them know about Camel- and Pascal-Casing and researched their respective origins on Wikipedia just about 5 Minutes before I stumbled accross your question. What a coincidance. ;-)
This is, what Wikipedia says: CamelCase (camel case or camel-case)—originally known as medial capitals[1]—is the practice of writing compound words or phrases in which the elements are joined without spaces, with each element's initial letter capitalized within the compound, and the first letter is either upper or lower case—as in "LaBelle", BackColor, "McDonald's", or "iPod". The name comes from the uppercase "bumps" in the middle of the compound word, suggestive of the humps of a camel. The practice is known by many other names. In computer programming if the first letter is capitalized, it is called Pascal case; if not, then camel case. While the article basically says that it doesn't matter whether you start with an upper case character or not as long as you capitilize each element's initial letter, it clearly states that in programming languages you need to start lower case. Otherwise it's called pascal case. ;-) -Chris Christian Jacob, Aug 02, 2010
|