Re: [off] PHP: a fractal of bad design

From: Date: Wed, 18 Apr 2012 08:53:01 +0000
Subject: Re: [off] PHP: a fractal of bad design
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message

On Apr 18, 2012, at 1:34 AM, Hartmut Holzgraefe wrote:

> On 04/10/2012 06:20 PM, Adir Kuhn wrote:
>> Hi folks,
>> 
>> today I read this post, I think that some points are valid, follow the link for
>> you guys
> 
> as stuff like this comes up again and again (although not in as epic
> lenght as this one) i've been thinking whether it might make sense to
> have some
> 
> "PHP Gotchas, how they came to be, and why we can't simply fix them"
> 
> FAQ section in the manual or wiki?
> 
> If nothing else it would at least help with dealing with this kind
> of rant (nothing new here, move along, your concerns were already
> covered in ### in great detail), but also might help that would
> indeed want to understand why some things are as they are.
> 
> I'd rather proactively own this kind of discussions than just
> jump into them whenever they arise elsewhere …

Hello Hartmut,

Agreed, and I think it belongs in the manual. An example (not being
proposed as such, but is a rough idea):

  Why are function naming schemes seemingly random?

    PHP glues many different API's together, and sometimes this
    gets messy. PHP leans towards the C variant which is why the
    likes of strlen() vs str_replace() exists, and …

As opposed to our current approach, which is via mailing lists and 
typically "RTFM." or "BC. Read archives." or the like. Ack!

And also include possible solutions/recommendations like this PHP FAQ
entry about haystack,needle ordering, which includes the following 
text:

    A simple rule of thumb is as follows: Array function parameters 
    are ordered as "needle, haystack" whereas String functions are the 
    opposite, so "haystack, needle".

And thankfully there are already a lot of sites to steal the questions 
from, and often answers live within their user comments. :)

Regards,
Philip



Thread (42 messages)

« previous php.internals (#60172) next »