Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62898 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73340 invoked from network); 7 Sep 2012 17:40:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2012 17:40:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=wfitch@meetme.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=wfitch@meetme.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain meetme.com designates 74.125.149.76 as permitted sender) X-PHP-List-Original-Sender: wfitch@meetme.com X-Host-Fingerprint: 74.125.149.76 na3sys009aob106.obsmtp.com Linux 2.5 (sometimes 2.4) (4) Received: from [74.125.149.76] ([74.125.149.76:52556] helo=na3sys009aog106.obsmtp.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 72/A1-65063-E913A405 for ; Fri, 07 Sep 2012 13:40:48 -0400 Received: from mail-gh0-f170.google.com ([209.85.160.170]) (using TLSv1) by na3sys009aob106.postini.com ([74.125.148.12]) with SMTP ID DSNKUEoxm8qdRki6ypn/9DotiDHvBWz3b5/E@postini.com; Fri, 07 Sep 2012 10:40:48 PDT Received: by ghbg24 with SMTP id g24so672210ghb.29 for ; Fri, 07 Sep 2012 10:40:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=H3OpU9OwZB3/cXkJ9WMrSaAk090uWhKGcj2XjV1sbk4=; b=DiWraFlO01wowOVvp2F6WaPxwEqcS9IE2X86krMMZIy4jK+f8/ayUCH7lb0/eptW89 rZ+ef/E3dlhIaAEnNK/fF1ft2TKHtLeu0HKz3Nj1C5E065goKaz91Z/q/X9wrLmexCwf HAWzOoVlvsFp7GYGxcKkLSQcir4YQluzWScAAnRkpwYeWU7EXqdr8a1Y/DwtZg2oBl/I 5S7VIKRNAaZKJTmKpMMWUM2uN7hgvxrcIgI6NeVz0kgCJK21E/y1/dFKJ8Cdv0chrsAJ LEjrDVpIGCQmbrhIfpi3wFPOeYtKkanOj1lz+5+u7zoSUQIAEdMQh6tBzfDTFHceYs6R +cUA== MIME-Version: 1.0 Received: by 10.58.12.231 with SMTP id b7mr8916434vec.28.1347039642080; Fri, 07 Sep 2012 10:40:42 -0700 (PDT) Received: by 10.58.132.161 with HTTP; Fri, 7 Sep 2012 10:40:41 -0700 (PDT) X-Originating-IP: [204.145.120.11] In-Reply-To: References: <504941BE.30102@sugarcrm.com> <50494740.6030205@sugarcrm.com> <504992B8.9050700@lsces.co.uk> Date: Fri, 7 Sep 2012 13:40:41 -0400 Message-ID: To: Mark Cc: Lester Caine , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7b41bf325d54ba04c9201b71 X-Gm-Message-State: ALoCoQnSUnbPoiRw884QR8gzLt3oj5/9lkunECaLyjLPXIRd97rJDwM/WatxJC9UBl5pSUd5uRtc Subject: Re: [PHP-DEV] Why are the PHP namespaces different compared to C++? From: wfitch@meetme.com (Will Fitch) --047d7b41bf325d54ba04c9201b71 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Sep 7, 2012 at 1:24 PM, Mark wrote: > On Fri, Sep 7, 2012 at 8:22 AM, Lester Caine wrote: > > Stas Malyshev wrote: > >> > >> Hi! > >> > >>> I wasn't assuming. I was outright making a factual statement. I never > >>> made any implications of the intellectual levels of those implementing > >>> the spec. I understand the RFC full well and know why the design is > >>> the way it is. I was answering the ops question. Please read what I > >>> said before you make your own assumptions. > >> > >> > >> Sorry, statements like "haphazard way", "never well designed", "it's a > >> mess", "they don't really resemble namespaces", "just some fancy magic", > >> etc. have nothing to do with facts. Actually, facts are exactly the > >> opposite - they were designed, were extensively discussed with > >> soliciting feedback from many stakeholders, and were implemented exactly > >> as planned. You may not like the way there were implemented, that's your > >> opinion (not a fact) and you are entitled to it. But you didn't limit > >> yourself to saying "I don't like them". You specifically said that they > >> were never well designed and haphazardly implemented. This is factually > >> false. > > > > > > Stas ... One thing to bear in mind is that even for those of us for whom > > English is our only language it is sometimes difficult to explain what we > > mean. Sherif's were perhaps a little 'provocative' but were an accurate > > reflection of his view on the results of implementing namespaces. It is a > > compromise rather than something that sits naturally in PHP? > > > > What a lot of newcomers need to understand is that PHP is NOT compiled, > so a > > heck of a lot of what they are used to just happening is physically > > impossible, and namespace is a good case in point. Personally I have yet > to > > see a good example of the use of namespaces in third party libraries, and > > like Sherif avoid them preferring simply so that while the code may be > more > > verbose, it's clear 5 years later what was intended :) A lot of the > current > > 'magic' makes it difficult to pick up and work with other peoples code > later > > on. > > Right, i have to correct you there. > You don't explicitly say it, but you do think that i'm a "newcommer". > That's far from the truth. I've been using PHP since 2001 and i > consider myself to be quite advanced in PHP usage. > > Back on the namespace topic. I won't judge on anything, but i know > namespaces from c++. I understand that PHP isn't a compiled language > and quite frankly that doesn't matter at all. What does matter is that > PHP uses the name: "namespace" which C++ obviously had earlier. > Naturally someone that knows both languaes (c++ and php) simply assume > that a namespace in php probably works the same as those in C++. If > that's not the case then it shouldn't even carry the "namespace" name. > Right, I have to correct you there. Just because a namespace doesn't act like C++'s namespace implementation doesn't mean it's not a namespace. A namespace is just an abstract container which groups unique symbols (names). The PHP implementation does exactly that. > > To me this namespace in php stuff just looks like and alias. So why > isn't it named as that: "alias"? I do not want to question the ones > that implemented namespaces in php, but i do think that the name > itself is at the very least confusing. > Because it behaves as a namespace. Again, just because the implementation isn't what you're used to, or even like, it still groups identifiers in abstract containers. I realize that the implementation and ZE backend may cause some confusion with 'aliasing', but it's use case is the same. Also note: use Some\Ns\Class as MyClass; There's an alias for you. ;) > > Also, lets keep this discussion polite people. I'm not here to smash > toes. All i would like to know is the reasoning behind the above and > if there is any intention of changing the namespaces to be more c++ > like. > > Cheers, > Mark > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --047d7b41bf325d54ba04c9201b71--