Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61756 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1171 invoked from network); 25 Jul 2012 12:43:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jul 2012 12:43:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=alex.aulbach@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=alex.aulbach@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.170 as permitted sender) X-PHP-List-Original-Sender: alex.aulbach@gmail.com X-Host-Fingerprint: 209.85.161.170 mail-gg0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:39697] helo=mail-gg0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6B/F2-19281-4F9EF005 for ; Wed, 25 Jul 2012 08:43:32 -0400 Received: by ggnf2 with SMTP id f2so739435ggn.29 for ; Wed, 25 Jul 2012 05:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=lvoEotcPcYNK6Qw0DmTJsK9cZvdfCRPQcjuJpNyoUcs=; b=veuvb1inosBn8vE0UKpW2HbUTdHxZwk5veYhMHBYRwTPLuSYmX2V1HDHrFF8Q1zehk c7dsmBd5L+/M2LpVAyz7HfEI67/0aRsn23ntD/FCyZa90FtV1as9o26CMr7gPHDnu+vL VyoTpdm6+OxHCPvNhTKokTEWRty6vXWSVaKQw7RqtF+6xBZY1cxr4r0qlSf9hBqrdatE 4KYrmRVIrB7aFAy7cfPnyjtNln2X3YPg4i3unBSyznllfbIupS/Gjiq/jnpwJntYRjrA lWQrScstbkU/eE00muudPni8JHSsIuH5Dt6xrmZFh3cOooGidp4G4cJgHgUhLCvM5oEh 9DKQ== MIME-Version: 1.0 Received: by 10.43.104.202 with SMTP id dn10mr24250046icc.29.1343220209521; Wed, 25 Jul 2012 05:43:29 -0700 (PDT) Received: by 10.64.44.234 with HTTP; Wed, 25 Jul 2012 05:43:29 -0700 (PDT) In-Reply-To: References: <500EDCC7.1020402@ajf.me> <500EE3B9.8010902@ajf.me> <500EEA76.1030407@ajf.me> Date: Wed, 25 Jul 2012 14:43:29 +0200 Message-ID: To: Sherif Ramadan Cc: Andrew Faulds , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Re: Generators in PHP From: alex.aulbach@gmail.com (Alex Aulbach) 2012/7/25 Sherif Ramadan : > I don't understand what you find non-conventional about functions or > methods that return objects. Again: I don't have any problems with the object returning. :) I see a problem that the mechanism isn't understood and used wrong. And I think, that it is too easy to oversee that it is not a "normal" PHP-function, because the "yield" is normaly in the middle of the code and "return" at the end. Both couldn't be changed. But it could help, if you name different things different. That's just better than nothing. And it's easy. I suggested that, but the arguments are some kind of ignored. "No, it's their problem" (of course it is, but it's our job to help them avoiding this) "No, functions can behave like this, because PHP is not consistent at all" (of course it is, but this is a completly new type) "No, we'll do it so, because other languages do it so and we are used to it" (What an argument is that? Do we want to make a java-clone?) > Just between PHP 5.2 and 5.4 we've gained traits, closures, > namespaces, function array derefrencing, access to member upon > instantiation, and lots of other lovely additions to the language. I > don't see languages like Java or Python evolving this quickly -- by > contrast. I don't see this as an compelling advantage. If it is done in the wrong way, the learning curve could become to steep. I have no problem with it, I use PHP every day, but as explained most PHP-developers will have problems and I can say that, because I've more than 20 years experience in that. Do you have that? Every new feature should match into context. This one doesn't. I suggested how to make it a little bit better and I explained why. I'm just wondering... for whom is PHP developed, for the PHP-internals or for PHP-developers? -- Alex Aulbach