Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25616 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3134 invoked by uid 1010); 11 Sep 2006 18:05:05 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 3119 invoked from network); 11 Sep 2006 18:05:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Sep 2006 18:05:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 80.74.107.235 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from [80.74.107.235] ([80.74.107.235:60880] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 71/D4-02095-F45A5054 for ; Mon, 11 Sep 2006 14:05:05 -0400 Received: (qmail 26746 invoked from network); 11 Sep 2006 18:03:46 -0000 Received: from office.zend.office (HELO ?192.168.61.128?) (192.168.16.109) by internal.zend.office with SMTP; 11 Sep 2006 18:03:46 -0000 Message-ID: <4505A549.4040004@zend.com> Date: Mon, 11 Sep 2006 11:04:57 -0700 Organization: Zend Technologies User-Agent: Thunderbird 1.5.0.5 (X11/20060725) MIME-Version: 1.0 To: =?UTF-8?B?VGVyamUgU2xldHRlYsO4?= CC: RQuadling@GoogleMail.com, dAniel hAhler , internals@lists.php.net 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> In-Reply-To: <004e01c6d5c9$5f9b16a0$9a02a8c0@pc> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: __autoloading and functions From: stas@zend.com (Stanislav Malyshev) > 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. > 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. > 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 :) Besides that, saving keystrokes was never a top priority for PHP (see how elaborate function names standard modules have). Keystrokes are cheap, clarity of the code isn't. > class. So in Java, instead of being able to write "sqrt()", you have > to write "Math::sqrt()". Always. > Frankly, I don't really see it as advantage or disadvantage, it's just another way to say the same. Java, for good and for bad, is much more organized and bureaucratic language than PHP. In PHP nobody makes you to use classes if you don't like them, 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. -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/