What is the difference between StudlyCaps and CamelCase?

后端 未结 4 1198
悲&欢浪女
悲&欢浪女 2021-02-01 15:59

PSR suggests, method names MUST be declared in camelCase and class names MUST be declared in StudlyCaps.

4条回答
  •  误落风尘
    2021-02-01 16:12

    StudlyCaps, also known as PascalCase, implies that the first capital of each subword is capitalized. camelCase implies, like a camel, that the humps are in the middle, therefore the first letter is not capitalized.

    Compare Microsoft's standards for .NET.

    Other well known capitalization styles are snake_case, where all words are concatenated in lowercase with underscores, and kebab-case, which is identical but uses a hyphen.

提交回复
热议问题