Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62896 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67201 invoked from network); 7 Sep 2012 17:25:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2012 17:25:16 -0000 Authentication-Results: pb1.pair.com header.from=markg85@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=markg85@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: markg85@gmail.com X-Host-Fingerprint: 209.85.215.42 mail-lpp01m010-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:44406] helo=mail-lpp01m010-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A3/40-65063-CFD2A405 for ; Fri, 07 Sep 2012 13:25:16 -0400 Received: by lahl5 with SMTP id l5so2052551lah.29 for ; Fri, 07 Sep 2012 10:25:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=kya2Tn3IcLxyZkhMmK/zFOtAG75nfbay1DKc4Umwcmw=; b=y2mqgBrQrW6pUxKXcZmtGkcgBOTyySkcLXdL3x8IsHfcJ6Mcx4Zu6E+sitFz0gGZxS lOCTEAOmm0/p158Jr7B6asESN8ssiGJMgcr8Dl0kVTuyRWQG9pERhfwJBWGpxdW16I5y khbSOSS+Vfo7rKX7mclcgP6XBN2k1A2I+36wHiMasLxKuvOkMYkSxhzl4xr06vJtxhTK RznrR+nl0NPMKHM2stZrsuwyuVxTmG0/c7HaEUgHuVc8tNSY80xJGNOOj+FiAidiSRPI AzeOFm7wxAP5wwLmP5bDqykNgyYO9++dkwnqdJPqcCSnfN1KW1bGxp1V+h2goC+MGsdw IFkw== Received: by 10.112.26.106 with SMTP id k10mr2437297lbg.100.1347038712970; Fri, 07 Sep 2012 10:25:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.92.9 with HTTP; Fri, 7 Sep 2012 10:24:52 -0700 (PDT) In-Reply-To: <504992B8.9050700@lsces.co.uk> References: <504941BE.30102@sugarcrm.com> <50494740.6030205@sugarcrm.com> <504992B8.9050700@lsces.co.uk> Date: Fri, 7 Sep 2012 19:24:52 +0200 Message-ID: To: Lester Caine Cc: "internals@lists.php.net" Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Why are the PHP namespaces different compared to C++? From: markg85@gmail.com (Mark) 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. 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. 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