I understand the reason to camel case variable names, but I've always wondered why you would camel case a method name? why is it toString() and not ToString()? What purpose does it serve?
相关问题
- Regular rxpression to convert a camel case string
- Powershell verb for destroying a resource
- Naming conventions for function parameter variable
- Resharper Naming Exception for “iPhone”
- Convert JSON camel case to snake case (and vice ve
相关文章
- Should I keep bad naming conventions?
- F# naming convention
- coding style checker for c (variable names, not in
- Fluent NHibernate primary key constraint naming co
- Is using camelCase in CSS ids or classes ok or not
- Naming conventions for controls [closed]
- [removed] regex CamelCase to Sentence
- Visual Studio CommandBar “Names”
Pascal case The first letter in the identifier and the first letter of each subsequent concatenated word are capitalized. You can use Pascal case for identifiers of three of more characters. For example: BackColor
Uppercase All letters in the identifier are capitalized. Use this convention only for identifiers that consist of two or less letters, or abbreviations, such as BSU and UCS. In the example below, IO and UI are the uppercase identifiers, whereas System follows the Pascal capitalization style because the length is greater than two. For example: System.IO; System.Web.UI
Camel case The first letter of an identifier is lowercase and the first letter of each subsequent concatenated word is capitalized. For example: backColor
The following Link summarizes the capitalization rules and provides examples for the different types of identifiers and items within your Web application/project.Hopefully this link will helpful for you
https://dotnetprod.bsu.edu/AdminConsole/Documentation/ASPDotNet/CodingStyle/NamingConventions/Capitalization.aspx
If you want a function
that takes less effort (one less SHIFT keypress) than
However, if you're writing to a file, you need to distinguish the words. Hence
is marginally more efficient (and still consistent with the first example)
A lot of conventions say you capitalize the first letter of types (classes, structs, enums, etc.), and use lowercase otherwise (functions, members, etc.).
If you follow that convention, you can then tell just by looking that
MyStruct.MyType
refers to a nested type, andMyStruct.myData
refers to some form of data, andMyStruct.myFunc()
refers to a function call.Because that's what the original designers of Java liked.
I don't think there is any reason, these are just conventions and everyone might have his own.
We use lower-case on the first letter to save a little ink in our printouts.