Over abbreviated 10

© Giant Ginkgo

Matthew Weier O’Phinney announced Zend’s naming scheme for the Zend Framework from the point where PHP 5.3 namespaces are used. The issue is, that the PHP parser does not allow class Abstract, neither interface Interface as both “abstract” and “interface” are reserved keywords. So Zend suggests prefixing interfaces with “I” and abstract classes with “A”. Hungarian notation for classes and interfaces.

One of the bullet points in the list of “what makes a name a good name?” is and will be forever “as short as possible, as verbose as needed”, other points are “you must understand the name without studying specific rules before”. The last is why hungarian notation sucks so tremendously. The IFoo/ABar violates two of those criteria: first it is not as verbose as it could be with just a few keystrokes more: AbstractBar would work fine and is much clearer. At second it introduces a special notation you have to grasp before. While AbstractBar would be as descripive as possible, ABar is cryptic for those who are not lucky enough to practice Python programming.

If we are at it, the scheme makes it impossible to have grammatically correct names: IFoo would be read as InterfaceFoo which really should be FooInterface. And no, the fix is not FooI.

Filed on 30-06-2008, 17:05 under , , & ten comments & one trackback


Trackback specific URI for this entry

  1. Trackback from WEBLOG (Tobias Schlitt - a passion for php)
    posted on June 30th 2008, 07:50:27 pm iRefuseToUse aNamingScheme


  1. Matthew Weier O'Phinney returns:
    published on June 30th 2008, 06:40:46 pm *


  2. Derick means:
    published on June 30th 2008, 08:19:55 pm *


  3. Pelle says:
    published on June 30th 2008, 08:50:09 pm *


  4. Lars Strojny returns:
    published on June 30th 2008, 09:13:40 pm *


  5. Richard@Home answers:
    published on July 2nd 2008, 12:50:15 pm *


  6. Richard Lord answers:
    published on June 30th 2008, 09:57:06 pm *


  7. Jay Pipes reckons:
    published on July 1st 2008, 06:10:42 pm *


  8. Lars Strojny returns:
    published on July 2nd 2008, 10:57:32 am *


  9. Evert returns:
    published on July 3rd 2008, 04:46:57 pm *


Add a Comment & let me know what you think