Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps outthere) [RSS Feed]

#1 Nov. 25, 2005 11:00:40

Matthias P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps outthere)


>
> 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.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#2 Nov. 25, 2005 11:17:07

Matthias P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps outthere)


> 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.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#3 Nov. 25, 2005 11:20:55

Christian S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps outthere)


Derick Rethans wrote:On Fri, 25 Nov 2005, Sascha Schumann wrote:I move that the class is renamed for the time being as to not
conflict with existing codebases, and release 5.1.1
expediently.I second that. Otherwise 5.1 is a dead branch lots of people won'tupdate to.Yes, and that will break code again as I just explained to SebastianKettler. And it will break *my* code ;-)Does that mean your code is more important than all the lines of codeout there? You must be kidding.And as you stated yourself your code hasn't even been released yet.Besides that, using "Date" and "Timezone" as classnames are the mostsensible names for those classes and I do not think we should havechange that.By the same logic the function file_get_contents() could be calledget(). Using generic names for core functionality in the global namespace is a bad thing, no matter how convenient the name might be. That'sa lesson PHP has learned for function names quite a while ago, let's notrepeat the same mistake for class names.And let's undo the slip before more harm is done.

- Chris

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#4 Nov. 25, 2005 11:30:24

Derick R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps outthere)


On Fri, 25 Nov 2005, Christian Schneider wrote:

> Does that mean your code is more important than all the lines of code
> out there? You must be kidding. And as you stated yourself your code
> hasn't even been released yet.

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.

> > Besides that, using "Date" and "Timezone" as classnames are the most
> > sensible names for those classes and I do not think we should have change
> > that.
>
> By the same logic the function file_get_contents() could be called get().

?

> Using generic names for core functionality in the global name space is a bad
> thing, no matter how convenient the name might be. That's a lesson PHP has
> learned for function names quite a while ago, let's not repeat the same
> mistake for class names.

No no, the core reserves the right to name whatever they want, it's the
userland code that is responsible for prefixing their classes.

Derick

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#5 Nov. 25, 2005 11:40:22

Matthias P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps outthere)


> 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

Offline

#6 Nov. 25, 2005 11:43:38

Gareth A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps outthere)


Derick Rethans wrote:Using generic names for core functionality in the global name spaceis a badthing, no matter how convenient the name might be. That's a lessonPHP haslearned for function names quite a while ago, let's not repeat the same
mistake for class names.No no, the core reserves the right to name whatever they want, it'sthe userland code that is responsible for prefixing their classes.True, but where part of the PHP project has already adopted that name,doesn't it make sense to assume that they have a first priority to this.This seems to fall back to the discussion a few months back about howmuch BC breakage people wanted to cause in 5.1/6 in any case. I thoughtthis was resolved back then, but evidently not.It'd seem to me that there's two options - just say that there'll bebreakage like this throughout the 5/5.1 release process and don't getanybody moving to it or to keep major breaking for major revisions - theway every other largescale opensource project works (and does so for adamn good reason).I'd personally far rather that such a break came in 5.1 over 5.1.1,though I still don't think a change which has such a major impact oversuch a large portion of the userbase is a good plan for a minor release(much less a maintainance release like 5.1.1); after all, there's beensome 259,000 downloads of pear's date class and I'd argue there's asubstantial amount of developers with their own date class outside ofthat group. You're effectively talking about hitting 300,000-500,000developers with a massive change on a minor release. You talk aboutdoing things the 'right' way often - well that's just plain wrong. Ok, I know it's not really breaking anything within php - but it'sbreaking a lot of apps.--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#7 Nov. 25, 2005 11:56:12

Christian S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps outthere)


Derick Rethans wrote:I didn't say that my code is more important, but if we don't get thedate class now, we will get it in 5.1.1 and then break your code - soYou're stating this like a fact. Date _can_ be renamed, there's nothingsacro-sanct about this class.Just to illustrate some question which could be raised to weaken yourpoint that Date is the one and only name for that class:Why does it include time as well, shouldn't it be Datetime (a la SQL)?Is it going to be the only class in ext/date (no, there is alreadytimezone)? => Shouldn't it be Date_Timezone and Date_Date/Date_Datetimethen?By the same logic the function file_get_contents() could be called get().?Because I personally feel that get() would be the right name for it thesame way you feel Date is the right name for your class.No no, the core reserves the right to name whatever they want, it's theuserland code that is responsible for prefixing their classes.Is that why function names were prefixed? Or __get?You sure have the right to introduce whatever you want but is it also*smart* to insist on a specific name if you could easily avoid conflicts?PHP moved on from "what is legal" to "what is right" a long time ago IMHO.As soon as we have separate namespaces for core/application classes wecan talk how to resolve issues like that again but for now I'd highlyappreciate if you'd take a more conservative approach.Cheers,
- Chris

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#8 Nov. 25, 2005 12:10:53

Derick R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps outthere)


On Fri, 25 Nov 2005, Christian Schneider wrote:

> Just to illustrate some question which could be raised to weaken your point
> that Date is the one and only name for that class:
> Why does it include time as well, shouldn't it be Datetime (a la SQL)? Is it
> going to be the only class in ext/date (no, there is already timezone)? =>
> Shouldn't it be Date_Timezone and Date_Date/Date_Datetime then?

No, why should it? We reserve the right to use whatever name we want in
the core (although prefixing internal classes with Pear would be sneaky ;-) )

> > No no, the core reserves the right to name whatever they want, it's the
> > userland code that is responsible for prefixing their classes.
>
> Is that why function names were prefixed? Or __get?

No, that's for logic's sense.

Derick

--
Derick Rethanshttp://derickrethans.nl|http://ez.no|http://xdebug.org--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#9 Nov. 25, 2005 12:23:37

Edin K.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps outthere)


Derick Rethans wrote:
> On Fri, 25 Nov 2005, Christian Schneider wrote:
>
>
>>Just to illustrate some question which could be raised to weaken your point
>>that Date is the one and only name for that class:
>>Why does it include time as well, shouldn't it be Datetime (a la SQL)? Is it
>>going to be the only class in ext/date (no, there is already timezone)? =>
>>Shouldn't it be Date_Timezone and Date_Date/Date_Datetime then?
>
>
> No, why should it? We reserve the right to use whatever name we want in
> the core (although prefixing internal classes with Pear would be sneaky ;-) )

Who is "we"? People bent on making life as difficult as possible for PHP
users? I'm sure you're not talking about the broad range of people here
and I would appreciate if you didn't make it sound like most of PHP
developers are behind your methods and attitude here.

Sneaking in date class like that is really unacceptable, and 5.1.1 with
it removed should be released ASAP.

Edin

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#10 Nov. 25, 2005 20:13:05

Marcus B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps outthere)


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.phpBest regards,
Marcus

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

  • Root
  • » PHP
  • » [PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps outthere) [RSS Feed]

Board footer

Moderator control

Enjoy the 22nd of January
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support