Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40658 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31423 invoked from network); 24 Sep 2008 07:06:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Sep 2008 07:06:30 -0000 Authentication-Results: pb1.pair.com header.from=arvids.godjuks@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=arvids.godjuks@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.92.171 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: arvids.godjuks@gmail.com X-Host-Fingerprint: 66.249.92.171 ug-out-1314.google.com Received: from [66.249.92.171] ([66.249.92.171:54105] helo=ug-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/54-00346-FE6E9D84 for ; Wed, 24 Sep 2008 03:06:26 -0400 Received: by ug-out-1314.google.com with SMTP id k3so1789820ugf.37 for ; Wed, 24 Sep 2008 00:06:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=1xqzcmNK2KFu4DcKSCyeFE+w2mb7cB1mENXM2EbQR1M=; b=fOUrxURc5TgYVlS/9avNVaZzHD8jRfWgw1Bn2l5rb1Cv+6mGTK6ZOLhQozys+JYQLg /sBoCRXcWa2gQmi5GjrctikCtsA+q01ZhAIuEnWgOnXxFwDEhp1IknZnKdLRNykDfG04 AW9pwfaWnHfGVO4Lw+UaSoa3xfZS8UOpjoi44= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=udLrRNBIWA7Y/36PJeyyQaHuVHsLzuL82pHIoWxjFaIiRSuECCT2uLMCuMoLWiSEH6 E0G6hhMCuPGWZZ+hGgNJ+s8oBW8M76tejpOZvbj5/4T7vkGvWi8jZyakBoew+ybiwT6S kiVGPe2VscB0nm5a2OejYEzjP0LLpI4wcsz2Q= Received: by 10.67.10.8 with SMTP id n8mr187319ugi.23.1222239978851; Wed, 24 Sep 2008 00:06:18 -0700 (PDT) Received: by 10.67.29.1 with HTTP; Wed, 24 Sep 2008 00:06:18 -0700 (PDT) Message-ID: <9b3df6a50809240006k7679b849k3075bbd4db7bf02b@mail.gmail.com> Date: Wed, 24 Sep 2008 10:06:18 +0300 To: "PHP Internals List" In-Reply-To: <3A.A3.33890.DD789D84@pb1.pair.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_116998_29503558.1222239978770" References: <59.6C.35835.FB3F8D84@pb1.pair.com> <20080924065741.50a30448.kevin@phpro.org> <002701c91dd1$89dad480$3ffc1f3e@foxbox> <3A.A3.33890.DD789D84@pb1.pair.com> Subject: Re: [PHP-DEV] true namespaces, yet another point of view From: arvids.godjuks@gmail.com ("Arvids Godjuks") ------=_Part_116998_29503558.1222239978770 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline I completely agree with jvlad's thoughts - for me namespace is ability to separate two different libraries from each other so that they don't conflict. I don't need namespaces just to write my own application using them to be cool, and I probably would never use a namespace for small or middle size application, but what I will surely do - namespace libraries witch I will use in my application, so that I don't have to use prefixes for my application functions and classes. AndIMHO, I _really_ _don't_ _want_ to remember those complicated rules for name resolution, importing namespaces. There is category of developers, witch will make a real mess of this. As I personally see namespaces: index.php addHandler('loader', $loader); $application->addHandler('db', $db); $application->addHandler('pdf', $pdf); $application->run(); $application->quit(); ?> Of course that isn't a good example, because Zend framework always has a class prefix "Zend", but they surely can use a namespace and remove that Zend in front of classes. And I don't see any point in "use NamespaceName as OtherName" - I open a project, there is namespace Foo used for libraries. Then I open some modules - there is Bar::get() in the code. What will I look for? Namespace Bar, especialy when many namespaces are used in application. imporing foo as bar is quite confusing. Yes, we programmers can handle such things, we can learn from our mistakes, but that's not the reason to make us masochist! I'm fed-up with teaching people all the time how to properly code in PHP or clean the code after such people. Really, sometimes PHP core developers should say to comunity "f*k you, we will do that the proper way" and just do. People are happy with Java, .NET and so on and nobody is complaining that they can't import namespace under other name than original (maybe in some languages you can do that, but I don't code much in other languages, so I can't say that for sure). This is called "standarts" - everybody knows that name "Foo" always means "Foo" if "Foo" package is used in application, and that nobody can import it as "Blah" - they will have to change the namespace in package itself and that's so stupid , that nobody will do that (well if they do - don't mess with such people at all). ------=_Part_116998_29503558.1222239978770--