Skip to content

[RFC] Class Naming: Always PascalCase #2553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions CODING_STANDARDS
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,36 @@ User Functions/Methods Naming Conventions
'buildsomewidget'
'getI()'

7. Classes should be given descriptive names. Avoid using abbreviations where
7. Class names should be descriptive nouns in PascalCase and as short as
possible. Each word in the class name should start with a capital letter,
without underscore delimiters (CamelCaps starting with a capital letter).
The class name should be prefixed with the name of the 'parent set' (e.g.
the name of the extension)::
without underscore delimiters. The class name should be prefixed with the
name of the "parent set" (e.g. the name of the extension) if no namespaces
are used. Abbreviations and acronyms as well as initialisms should be
avoided wherever possible, unless they are much more widely used than the
long form (e.g. HTTP or URL). Abbreviations, acronyms, and initialisms
follow the same letter-casing as any other word.

Good:
'Curl'
'FooBar'
'CurlResponse'
'HttpStatusCode'
'Url'
'BTreeMap' (B-tree Map)
'Id' (Identifier and Identity Document)
'Char' (Character)
'Intl' (Internationalization)
'Radar' (Radio Detecting and Ranging)

Bad:
'foobar'
'foo_bar'
'curl'
'curl_response'
'HTTPStatusCode'
'URL'
'BtreeMap'
'ID'
'CHAR'
'INTL'
'RADAR'

Internal Function Naming Conventions
----------------------
Expand Down