pear:rfc:pear2_class_naming
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
pear:rfc:pear2_class_naming [2009/05/28 15:29] – add reference to new PHP Standards group ashnazg | pear:rfc:pear2_class_naming [2009/09/20 19:01] – that should be #4 ashnazg | ||
---|---|---|---|
Line 3: | Line 3: | ||
==== Document Information ==== | ==== Document Information ==== | ||
* Title: PEAR2 Class Naming Conventions | * Title: PEAR2 Class Naming Conventions | ||
- | * Version: 0.1.0 | + | * Version: 0.2.0 |
- | * Status: | + | * Status: |
* Type: Informative Document | * Type: Informative Document | ||
* Wiki link: http:// | * Wiki link: http:// | ||
+ | * Last Updated: | ||
+ | * Passed: | ||
==== Author(s) Information ==== | ==== Author(s) Information ==== | ||
* Name: Chuck Burgess | * Name: Chuck Burgess | ||
- | * Name: | + | * Name: |
* Email: [[pear-group@php.net]] | * Email: [[pear-group@php.net]] | ||
Line 32: | Line 34: | ||
New guidelines for PEAR2: | New guidelines for PEAR2: | ||
- | * syntax/ | + | * syntax/ |
- | * such suffixing is not preferred, but neither is it outlawed | + | * such suffixing is required for abstract classes and interfaces, for additional clarity to non-native English readers [4] |
===== Issues ===== | ===== Issues ===== | ||
- | A debate was spurred by the use of actual classes whose names, once namespaces removes their Several_Prefix_Layers_ from the name, will be just " | + | A debate was originally |
===== Proposed Solution ===== | ===== Proposed Solution ===== | ||
+ | |||
Initial rules and guidelines: | Initial rules and guidelines: | ||
- | * no suffix for an Abstract or Interface class name is necessary, nor is it preferred | + | * a suffix for an Abstract or Interface class name is required |
- | * attempts to misuse abstract classes and interfaces in userspace code will be caught by PHP anyway | + | * the extra naming is more legible |
- | * any extra naming is effectively just for code readers | + | * the suffix |
- | * any extra naming | + | |
* this follows other well-known conventions (e.g. Java) | * this follows other well-known conventions (e.g. Java) | ||
- | * an "Abstract" suffix is tolerable, e.g. abstract | + | |
- | * having it suffixed makes it work better with IDE's autocompletion... otherwise, you'll always find yourself typing | + | The only exception to the Interface suffix requirement is the base package exception, which must be named simply |
- | * an " | + | |
+ | One benefit of the suffix | ||
===== Examples ===== | ===== Examples ===== | ||
Line 59: | Line 62: | ||
* Demonstrating the new rules proposed by this RFC | * Demonstrating the new rules proposed by this RFC | ||
- | * " | + | |
- | + | | |
===== References ===== | ===== References ===== | ||
* [1] PEAR1 Coding Standards for Class Naming -- [[http:// | * [1] PEAR1 Coding Standards for Class Naming -- [[http:// | ||
- | * [2] [[Weierophinney]]'s original post about potential naming conflicts once Namespaces arrive -- [[http:// | + | * [2] [[weierophinney]]'s original post about potential naming conflicts once Namespaces arrive -- [[http:// |
+ | * [3] PHP Standards Group' | ||
+ | * [4] [[weierophinney]]' |
pear/rfc/pear2_class_naming.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1