Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does C# use a different Naming convention? [closed]

I started working with C# recently and I noticed that the convention seems to be that the variables start with a capital letter along with the methods.

Is this the only language that does this and why? For instance:

Page Page = new Page();
Page.Action(); 

In other languages, you'd see instead:

Page page = new Page();
page.action();

There are other examples of this that are confusing since I've worked a lot with UML, Ruby, C++ and Java.

My question is, why does C# do it this way when other languages do not?

Edit

Other Stack Overflow users are noting that C# does not follow this convention, this was just a mistake on my part.

like image 476
marcgg Avatar asked Apr 29 '09 15:04

marcgg


1 Answers

Well actually, no: the convention in C# is for camelCased variable (and field) names, and PascalCase methods:

Page page = new Page();
page.Action();
like image 184
Marc Gravell Avatar answered Sep 22 '22 03:09

Marc Gravell