pear:rfc:pear2_class_naming
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
pear:rfc:pear2_class_naming [2009/05/28 16:07] – change the stance on abstract/interface suffixes, as per Standards group decision ashnazg | pear:rfc:pear2_class_naming [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
==== Document Information ==== | ==== Document Information ==== | ||
* Title: PEAR2 Class Naming Conventions | * Title: PEAR2 Class Naming Conventions | ||
- | * Version: | + | * Version: 1.0.0 |
- | * Status: | + | * Status: |
* Type: Informative Document | * Type: Informative Document | ||
* Wiki link: http:// | * Wiki link: http:// | ||
+ | * Last Updated: | ||
+ | * Passed: | ||
+ | |||
+ | This RFC has been incorporated into the PEAR2 Standards ([[pear/ | ||
==== 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 33: | Line 37: | ||
New guidelines for PEAR2: | New guidelines for PEAR2: | ||
* syntax/ | * syntax/ | ||
- | * such suffixing is required for abstract classes and interfaces, for additional clarity to non-native English readers | + | * such suffixing is required for abstract classes and interfaces, for additional clarity to non-native English readers |
===== 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 64: | ||
* Demonstrating the new rules proposed by this RFC | * Demonstrating the new rules proposed by this RFC | ||
- | * " | + | |
- | + | | |
===== References ===== | ===== References ===== |
pear/rfc/pear2_class_naming.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1