Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31570 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28869 invoked by uid 1010); 14 Aug 2007 17:54:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 28854 invoked from network); 14 Aug 2007 17:54:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Aug 2007 17:54:19 -0000 Authentication-Results: pb1.pair.com header.from=david.coallier@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=david.coallier@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: david.coallier@gmail.com X-Host-Fingerprint: 66.249.92.171 ug-out-1314.google.com Received: from [66.249.92.171] ([66.249.92.171:43365] helo=ug-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/60-25838-94CE1C64 for ; Tue, 14 Aug 2007 13:54:18 -0400 Received: by ug-out-1314.google.com with SMTP id c2so117319ugf for ; Tue, 14 Aug 2007 10:54:15 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=a3Bczgd8rafi6i5nJYwS+K9LYR8EUf7AFXdnOXSwf0n6iTItX87GVlu6BuP7zRZJRGy9h533p/ODdsc6UodmBiPsrxRy/1wtBGtcdk4cLOM8tWpvO+2yBIHAsvdDkaho9R4Rp39lsl41FMyiyhIV3NKITtit8XoEMvPpAcrSfms= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=e3uOQyCJR5sbk1Gnk3VcsPK0MBPcKAyk4dtQl5OSHkgUl4UDzQjm1rzDVsAuFi4c4sPBQh/v2swhXQ/xREqhgL25hX8EfN2l5xEhwBn6QZtymTy+/eUcL6dOJrlZGcPmxxCgg7GYJgevbfLQdyBHWzvGeu3cX5Maf6h9UqflSBg= Received: by 10.142.51.4 with SMTP id y4mr322715wfy.1187113691542; Tue, 14 Aug 2007 10:48:11 -0700 (PDT) Received: by 10.143.33.15 with HTTP; Tue, 14 Aug 2007 10:48:11 -0700 (PDT) Message-ID: Date: Tue, 14 Aug 2007 13:48:11 -0400 Sender: david.coallier@gmail.com To: "Guilherme Blanco" Cc: "Marcus Boerger" , "Stanislav Malyshev" , "PHP Internals" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <46BE14B1.5050209@zend.com> <101178402.20070814174515@marcus-boerger.de> X-Google-Sender-Auth: f8474b5a70e316a2 Subject: Re: [Fwd: Re: [PHP-DEV] Renaming namespaces to packages] From: davidc@php.net ("David Coallier") On 8/14/07, Guilherme Blanco wrote: > I am not the one that want to put more fire in this entire > discussion... I'm tired of listening (this is like package or like > namespace or because my students like it or even that PHP has a unique > implementation). > > I've read all comments and I think I can give my 2 cents. > > Instead of keep talking about namespace or package, enlist feature > that both have to deal and how PHP solve it. The PHP behaves more like > package or namespace in this feature? Count all the winners and the > major is the result that everybody is expecting. > > Let me point examples... > > Subject: File Struture > Comments: > Namespace do not restrict directories (AFAIK) > Packages restrict directories (each package have a directory with its > name, like Zend/Cache/File.php) > > Question: What is the behavior of PHP in this situation? > PHP restricts the directory, just like packages. So, > Zend/Cache/File.php is the package Zend::Cache and has the class named > File > > Winner: package > > > Multiple namespaces/packages in one file: > .... > > > > Make a list, define how PHP deals with any situation and the count > winner is the answer for the so discussed question. > > > Regards, > > On 8/14/07, Marcus Boerger wrote: > > Hello Stanislav, > > > > JS has not much in common with PHP so it shouldn't be used as just an= other > > language to steal ideas from. Actually we are speaking of an OO feature= here > > and when it comes to that than the two are very different. PHP on the o= ne > > hand uses class based OO (like C++ and Java) while JS uses prototype ba= sed > > OO. And anyway, are we struggling to find excuses here? Can we in no wa= y > > ever at least try to be consistent in anything we do? That JS argument = is an > > extremly bad far fetched argument. > > > > marcus > > > > Saturday, August 11, 2007, 9:57:37 PM, you wrote: > > > > > > > -------- Original Message -------- > > > Subject: Re: [PHP-DEV] Renaming namespaces to packages > > > Date: Fri, 10 Aug 2007 10:03:25 -0700 > > > From: Stanislav Malyshev > > > Organization: Zend Technologies > > > To: Keryx Web > > > References: <001401c7db45$feeb0530$6e02a8c0@thinkpad> > > > > > > <46BC927B.8070402@zend.com> <46BC9778.5080406@keryx.se> > > > > >> FWIW. I teach PHP and for most students I believe their other > > >> implementation of namespaces will soon be the one in ECMAScript > > >> 4/JavaScript 2. > > > > > Thanks for mentioning it! From what I can see, their idea of namespac= es > > > is radically different from what C++ is doing and equally different f= rom > > > what packages are anywhere. They basically introduce an orthogonal > > > namespacing plane (or we can call it attribute set that can be applie= d > > > to any name) which can be operated independently of the main namespac= e. > > > It's interesting and can be a powerful tool but I imaging how > > > mind-boggling would be the code seriously using that capability. > > > > > And they, btw, are not ashamed of calling it namespaces just because > > > it's not c++ > > > > >> From what I gather it looks a lot like this one for PHP, and packag= es > > >> in JS 2 is something more different. > > >> http://developer.mozilla.org/presentations/xtech2006/javascript/ > > > > > The packages there, however, seem very much like Java ones with addit= ion > > > of braces. > > > > > P.S. I see you didn't send that to the list - will it be OK to forwar= d > > > it and my response there? I think it's interesting contribution to th= e > > > discussion. > > > -- > > > Stanislav Malyshev, Zend Software Architect > > > stas@zend.com http://www.zend.com/ > > > (408)253-8829 MSN: stas@zend.com > > > > > > > -- > > > Stanislav Malyshev, Zend Software Architect > > > stas@zend.com http://www.zend.com/ > > > (408)253-8829 MSN: stas@zend.com > > > > > > > > > > Best regards, > > Marcus > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > Guilherme Blanco - Web Developer > CBC - Certified Bindows Consultant > Cell Phone: +55 (16) 9166-6902 > MSN: guilhermeblanco@hotmail.com > URL: http://blog.bisna.com > S=E3o Carlos - SP/Brazil > Short and sweet. Here's a test, anyone.. write up an example of a python package, a java package, a c++ namespace and c# namespace. Then show us how to use them and it should be clear enough on what we have in PHP. I'll make the first part: --------------------------------------------------------------- C#: --File: csNamespace.cs (The namespace code extended example))-- namespace NameOne { namespace HierarchicalNamespace { namespace SomeOtherName { public class SayHi { public string sayHi() { System.Console.WriteLine('Hi..'); } } } } } --File: csUtil.cs (Invoking the NS)-- using NameOne.HierarchicalNamespace.SomeOtherName; ------------------------------------------------------------- c++: --File: cppNamespace.lh (The namespace code)-- namespace NameTwo { namespace AnotherHierarchyNamespace { int someInt; } class SomeClass { } } --File: cppUtil.cpp (Invoking the NS)-- #include "cppNamespace.lh" namespace SomeAlias =3D NameTwo::AnotherHierarchyNamespace; --------------------------------------------------------------- Python: --File: nameUtil.py-- def showName(name): # method that outputs the name ... print name --File: output.py-- >>> import nameUtil >>> nameUtil.showName('david') or >>> from nameUtil import showName >>> showName('david') --------------------------------------------------------------- Java: --File: namespace.java (The package code)-- package namespace; public class IamAClass { public static void main(String[] args) { System.out.println("Hello namespace?"); } } --File: javaUtil.java-- import namespace.*; Go, unleash hell of comments! :) and yes the current implementation does behave a bit more like java and even looks similar to java, now it's only a matter of marketing right ? Do we go with what people know and how they do it already or we go our way ? People from C++ will be confused as they will if they do java, but people from java will be less (and there's a lot of students learning java) confused. Whereas if we go __our__ way, we will confuse both the java'ers and the cpp'ers and the csharp'ers. So now everyone gave their opinions, it's time to find solution. If no one agrees on the name, why don't we make a normal poll ? Overwhelming ? Very.. but hey, the name is a big decision that will affect the usage, reputation, and education of our users/developers meaning that anyone who used some namespaces or packages in their way will need some education or re-education, and we might need to tend towards a name that is closer to something that already exists instead of using a name only for marketing purposes that is not really the meaning of an existing technology. Anyhow, let's get this thread back in line and not talk about ECMAscript (one can open a thread for that) and try to get this resolved quick ? Sounds good ? We've got namespaces in, and a patch already made for packages, now only time to take a decision, I propose that the next emails only contain the word ('namespace', 'package') and an explanation of why they think it would be better for the future of PHP but no arguments, only answers. That way, we'll have a clean list of answers about what people think and why that we can keep compile for future references when people ask why we did not choose the other choice. Thanks, D