简体   繁体   中英

camelCase with lowercase initial with names

Many coding standards recommend using camelCase with lowercase initial for variable and function names. What is the standard practice if the initial should be uppercase for "grammatical reasons", eg, because it is a name? For instance, shall I write KnuthPlassAlgorithm or knuthPlassAlgorithm ?

It depends on your language and who you ask. Generally you "camelCase" local variables and "ProperCase" FunctionNames or ProtectedMemberVariables. Often people use an underscore then camel case for _privateVariables. If you want to not have to think about it and you are using VS and C# you should check out stylecop

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM