Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25617 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21364 invoked by uid 1010); 11 Sep 2006 18:42:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 21332 invoked from network); 11 Sep 2006 18:42:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Sep 2006 18:42:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=tslettebo@broadpark.no; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=tslettebo@broadpark.no; sender-id=unknown Received-SPF: error (pb1.pair.com: domain broadpark.no from 80.202.4.58 cause and error) X-PHP-List-Original-Sender: tslettebo@broadpark.no X-Host-Fingerprint: 80.202.4.58 osl1smout1.broadpark.no Solaris 9 Received: from [80.202.4.58] ([80.202.4.58:37369] helo=osl1smout1.broadpark.no) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/D6-02095-72DA5054 for ; Mon, 11 Sep 2006 14:38:33 -0400 Received: from osl1sminn1.broadpark.no ([80.202.4.59]) by osl1smout1.broadpark.no (Sun Java System Messaging Server 6.1 HotFix 0.05 (built Oct 21 2004)) with ESMTP id <0J5F00BBKYG33E20@osl1smout1.broadpark.no> for internals@lists.php.net; Mon, 11 Sep 2006 20:38:27 +0200 (CEST) Received: from pc ([80.203.129.59]) by osl1sminn1.broadpark.no (Sun Java System Messaging Server 6.1 HotFix 0.05 (built Oct 21 2004)) with SMTP id <0J5F00MKCYG33653@osl1sminn1.broadpark.no> for internals@lists.php.net; Mon, 11 Sep 2006 20:38:27 +0200 (CEST) Date: Mon, 11 Sep 2006 20:38:32 +0200 To: Stanislav Malyshev Cc: RQuadling@GoogleMail.com, dAniel hAhler , internals@lists.php.net Message-ID: <002401c6d5d1$7c180d30$9a02a8c0@pc> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 X-Mailer: Microsoft Outlook Express 6.00.2800.1807 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7BIT X-Priority: 3 X-MSMail-priority: Normal References: <015801c6d4d5$6440d1d0$9a02a8c0@pc> <7f3ed2c30609100744x7a5d4fdfs9601ae4671b351d3@mail.gmail.com> <003401c6d4ee$1b251d80$9a02a8c0@pc> <1803358544.20060910173549@marcus-boerger.de> <29.48.46429.82A54054@pb1.pair.com> <10845a340609110106y5a21de3coc98659cde5ef0465@mail.gmail.com> <450591E5.7080402@zend.com> <004e01c6d5c9$5f9b16a0$9a02a8c0@pc> <4505A549.4040004@zend.com> Subject: Re: [PHP-DEV] Re: __autoloading and functions From: tslettebo@broadpark.no (=?UTF-8?Q?Terje_Sletteb=C3=B8?=) > > Or "namespaces"... Or just plain "modules". Classes is not the only way to > > group things, and may not be the best (namespaces can typically be > > > Oh, of course it's not the only way. It's the only way native to PHP though. Yes. > > re-opened, so functions and classes belonging to a namespace can span > > several files, instead of everything having to be in _one_ file). > > > Thus, how do you suppose autoloading function would know which file to > load? We are back to the "complex ugly logic" argument. That's not something I've thought through: I just wanted to point out that classes are not the only way to group things. I've quite recently started to read the postings, here, but I intend to read up on the relevant discussions in previous postings to the list, to know what has been discussed, and what has come from it. > > Why? Besides the above, because you may want to be able to call a function > > like: > > > > f(); > > > > and not: > > > > SomeClassToWrapItAll::f(); > > > You may call the class x if you like one-letter names :) No thanks, I prefer readability. :) > Besides that, saving keystrokes was never a top priority for PHP Uah... > (see how elaborate function names standard modules have). Yes... "Wonderful", isn't it? :) Sorry, like I said, I'll read up on previous discussion of things like namespaces, before jumping into a discussion about them. Still, just one observation...: Verbosity rarely lead to clarity, it's rather the other way around. > Keystrokes are cheap, clarity of the code isn't. Clarity is very important, but always spelling things out in full may lead to less clear code. However, I'd think this is a discussion that is more appropriate at php-general... > I am just saying trying to make > functions behave like they belong to class or module without either > saying "class" or "module" (i.e. include) may not be the best idea to > support. I'm not sure I follow you... In for example Java, you have packages (modules), and you may either use the full name of a class all of the time, such as "java.lang.Math::sqrt(...)" or "Math::sqrt(...)" (or even "sqrt(...)", in a language supporting free functions). You seem to argue for the first one, for "clarity"... In either of the above cases, you specify where a function belongs, both where it's defined, and where it's used (either through full qualification, or a shorter one, using "import"). I'm not arguing for a function to "magically" become a part of a class/module/whatever, if you thought so (there's way too much "magic" in PHP as it is, and the separation between what "implementors" can do, and what "userland" is allowed to, is not a separation I like, either, but that's another discussion). Regards, Terje