FAQ

Then I have to ask both of you: why is there no mentioning in
the release notes or the upgrading guide regarding "Date"
being reserved for PHP now?
I was also curious as to that. Once again the release announcement (more
precisely, the "upgrade" document) greatly understates the impact:

"9b. Class constants in new PHP 5.1 extensions
[...]in order to minimise pollution of the global namespace in PHP.
Note that the new Date class exists at this point purely to allow the
core date extension to adhere to the above convention, although extended
functionality is planned for the the class in the future. "

At least I'd say this is "diplomatic". You need to have a delicate
understanding to even notice it, let alone understand the impact.

And as to "polluting the global namespace" - well, this one is a
supertanker that has just sunk at the shore of OOP.
The language/base library might want to reserve certain
simple classnames for itself. That is its right.
Not, not even that when it comes to most obvious names like "Date" (or
Page; User; Form...) or to commonly used ones (like Controller,
Database, DAO, Singleton, Observer...).
But: Doing so in a minor release is absolutely bad timing.
It gets worde because there apparently has been _no_
documentation of the fact at all. How shall our users
prepare themselves appropiately?
Not even in a minor relase, but with the very last RCs. This is a smack
in the face of all who even tried to keep up.

-mp.

Search Discussions

  • Matthias Pigulla at Nov 25, 2005 at 11:16 am

    Yes, and that will break code again as I just explained to
    Sebastian Kettler. And it will break *my* code ;-)
    Too bad I don't find the right mail to qoute you now literally - but
    nobody forces you to use the official PHP codebase for your stuff; go
    ahead and maintain releases for yourself.

    Unfortunately my english vocabulary lacks words powerful enough to
    express what I think about "your code" and your damn arrogance.

    In no way I have contributed as much as you but that does not stop me
    from stating that this is once again a maximum credible accident for the
    PHP project as a whole; and once again the way you comment on this as
    one of the very core developers is major PR disaster.

    The way things went is so incredibly ridiculous that everyone being
    responsible for major IT budgets, investments or decisions will be
    laughing at the project and its community as a whole.

    -mp.
  • Derick Rethans at Nov 25, 2005 at 11:31 am

    On Fri, 25 Nov 2005, Matthias Pigulla wrote:

    Yes, and that will break code again as I just explained to
    Sebastian Kettler. And it will break *my* code ;-)
    Too bad I don't find the right mail to qoute you now literally - but
    nobody forces you to use the official PHP codebase for your stuff; go
    ahead and maintain releases for yourself.
    I am sure that that quote would have been taken out of context though.
    In no way I have contributed as much as you but that does not stop me
    from stating that this is once again a maximum credible accident for the
    PHP project as a whole; and once again the way you comment on this as
    one of the very core developers is major PR disaster.
    I don't see so, calling the class "date" is the only proper name for it.
    Other applications are going to break regardless of in which version
    5.1.0/5.1.1 we would have introduced it. We thought it was better to do
    it in 5.1.0 instead, and unfortunately it made it into a too late
    release candidate.

    Derick
  • Christian Schneider at Nov 25, 2005 at 12:08 pm

    Derick Rethans wrote:
    I don't see so, calling the class "date" is the only proper name for it.
    Oh, just realized another little detail: Why the heck was the class
    called date instead of Date? Creating case-sensitivity legacy at this
    point in time is something which shouldn't have slipped past QA. Maybe
    we *do* need more time between RCs and releases.

    - Chris
  • Matthias Pigulla at Nov 25, 2005 at 11:39 am

    I didn't say that my code is more important, but if we don't
    get the date class now, we will get it in 5.1.1 and then
    break your code - so that doesn't really matter. THe only
    correct solution is to start prefixing the pear date class,
    as that needs to be done in the long run anyway.
    Derick, this is not only about the PEAR date class but about pretty much
    every larger PHP codebase/project. You don't seem to understand the
    impact.
    No no, the core reserves the right to name whatever they
    want, it's the userland code that is responsible for
    prefixing their classes.
    Actually I just decided to work through my 100,000 lines of code and
    rename every class; for the sake of forwards compatibility, I'll
    generate GUIDs for each class and keep a mapping table on my desktop.
    Oh, and while I'm at it, I'll switch over to some other language as
    well.

    -mp.
  • Derick Rethans at Nov 25, 2005 at 12:07 pm

    On Fri, 25 Nov 2005, Matthias Pigulla wrote:

    I didn't say that my code is more important, but if we don't
    get the date class now, we will get it in 5.1.1 and then
    break your code - so that doesn't really matter. THe only
    correct solution is to start prefixing the pear date class,
    as that needs to be done in the long run anyway.
    Derick, this is not only about the PEAR date class but about pretty much
    every larger PHP codebase/project. You don't seem to understand the
    impact.
    Yes, I do see that. Read my other mails again. (afaik one to Sascha)

    regards,
    Derick
  • Marcus Boerger at Nov 25, 2005 at 8:12 pm
    Hello Matthias,

    i think you didn't understand the whole point here. Naming something
    after an every day word just like 'Date' is like screaming for problems in
    bigger scenarios. It is a beginners mistake to not prefix such stuff.
    And if you weren't in a big project - well then simply rename your few
    hundred lines of code. Use some nice tools like Ultraedit since your a
    windows user the renaming is only a few clicks a way.

    marcus

    Friday, November 25, 2005, 12:39:45 PM, you wrote:
    I didn't say that my code is more important, but if we don't
    get the date class now, we will get it in 5.1.1 and then
    break your code - so that doesn't really matter. THe only
    correct solution is to start prefixing the pear date class,
    as that needs to be done in the long run anyway.
    Derick, this is not only about the PEAR date class but about pretty much
    every larger PHP codebase/project. You don't seem to understand the
    impact.
    No no, the core reserves the right to name whatever they
    want, it's the userland code that is responsible for
    prefixing their classes.
    Actually I just decided to work through my 100,000 lines of code and
    rename every class; for the sake of forwards compatibility, I'll
    generate GUIDs for each class and keep a mapping table on my desktop.
    Oh, and while I'm at it, I'll switch over to some other language as
    well.
    -mp.
    --
    PHP Internals - PHP Runtime Development Mailing List
    To unsubscribe, visit: http://www.php.net/unsub.php



    Best regards,
    Marcus
  • Martin Jansen at Nov 26, 2005 at 8:50 am

    On Fri Nov 25, 2005 at 09:1028PM +0100, Marcus Boerger wrote:
    i think you didn't understand the whole point here. Naming something
    after an every day word just like 'Date' is like screaming for problems in
    bigger scenarios. It is a beginners mistake to not prefix such stuff.
    Assuming this is correct, then not only userland code should use proper
    prefixes, but also the PHP language core should do so, no?

    Speaking of this, I like Greg's suggestion about prefixing all internal
    classes with PHP_. While there are certainly classes out there that are
    prefixed with it, we could tell developers that starting with e.g. PHP 6
    the PHP_* class scope is reserved for the language core and must not be
    used for any other purpose.

    - Martin
  • Ron Korving at Nov 26, 2005 at 8:56 am

    Speaking of this, I like Greg's suggestion about prefixing all internal
    classes with PHP_. While there are certainly classes out there that are
    prefixed with it, we could tell developers that starting with e.g. PHP 6
    the PHP_* class scope is reserved for the language core and must not be
    used for any other purpose.

    - Martin
    Why would you, if you have namespaces?

    Ron
  • Martin Jansen at Nov 26, 2005 at 9:12 am

    On Sat Nov 26, 2005 at 09:5522AM +0100, Ron Korving wrote:
    Speaking of this, I like Greg's suggestion about prefixing all internal
    classes with PHP_. While there are certainly classes out there that are
    prefixed with it, we could tell developers that starting with e.g. PHP 6
    the PHP_* class scope is reserved for the language core and must not be
    used for any other purpose.
    Why would you, if you have namespaces?
    Correct me if I'm wrong, but I got the impression that despite Jessie's
    patch and Marcus' competence in all things C people are still unsure if
    namespaces will make it into PHP 6. Thus having an alternative strategy
    at hand seems wise.

    Best,
    - Martin
  • Marcus Boerger at Nov 26, 2005 at 12:04 pm
    Hello Martin,

    the funny thing here is that obviously we cannot prefix things we have
    right now. Using namepsaces we would be free to enforce namespaces upon
    everyhting that's been built in and simply provide import. And if we
    really wanted to we could also have a "zend.ze1_compatibility_mode" like
    ini setting to import anything to the global space and voila - the php 6
    code writers can go without and those who want to use php 5 stuff can
    easily do so. There won't be aproblem for namespaces users when imporint
    things to the global space.

    marcus

    Saturday, November 26, 2005, 10:12:56 AM, you wrote:
    On Sat Nov 26, 2005 at 09:5522AM +0100, Ron Korving wrote:
    Speaking of this, I like Greg's suggestion about prefixing all internal
    classes with PHP_. While there are certainly classes out there that are
    prefixed with it, we could tell developers that starting with e.g. PHP 6
    the PHP_* class scope is reserved for the language core and must not be
    used for any other purpose.
    Why would you, if you have namespaces?
    Correct me if I'm wrong, but I got the impression that despite Jessie's
    patch and Marcus' competence in all things C people are still unsure if
    namespaces will make it into PHP 6. Thus having an alternative strategy
    at hand seems wise.
    Best,
    - Martin



    Best regards,
    Marcus

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
categoriesphp
postedNov 25, '05 at 10:59a
activeNov 26, '05 at 12:04p
posts11
users6
websitephp.net

People

Translate

site design / logo © 2022 Grokbase