Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104681 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8558 invoked from network); 12 Mar 2019 19:46:27 -0000 Received: from unknown (HELO mail-lf1-f52.google.com) (209.85.167.52) by pb1.pair.com with SMTP; 12 Mar 2019 19:46:27 -0000 Received: by mail-lf1-f52.google.com with SMTP id u68so2575629lff.7 for ; Tue, 12 Mar 2019 09:36:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9JTV8uYRASIsfvK7fbAfRNNG5+z62uw47qZPlvlS0Ew=; b=HArHOW1A84N8PBdsIA/dmK615uQugLJirUJUiZBsCfof8noim5BprH1d/GZtqrezbc HLW7yPvOKTZTfD80Xd67zxqRnJN1bJIUlD/0Nj1cEGd1UnT32D1B3RbkcDwd/Axmpqui kv0FESxRFwpLHoQoclDzzOvKkU/wyovRo5uzxtVb1tSNqIJHZ+AAPbKnnj3rfwbeRRgi 5gIdB80GmvtTjbI6u9ettqN7XksyolOaK5PwnE7XmKflYO5YH4kRDq+fLDJ+Sig6CUpQ q9IzUWKSQB49WO1AMj+ZgyvPZEX8z2rsEtsTfK9jTHUGMR93IDcWbR/ug5pZ7UuEbKSM ZYOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9JTV8uYRASIsfvK7fbAfRNNG5+z62uw47qZPlvlS0Ew=; b=QnnYTEW8lZGk6y2eLFWNgvgnCotIxdVwFnizOHTqgpjiwi5Eal7jnG6H6Xu5+I4Z5M AJfsUFUbIgbRPPwaFUnMQopk7b6lWbSbCyZZgmhu2ybw1OL0RyXRB7KqGejjWPZp6doD hpMZ+GsiVqHcYJpcdG2NlpGs2U6ZaoKPx5Is9w6sB8MRQ1HiYwTJ14ZTHxNwZMAr44kZ OYcFgw+tadim663VCFtd1R+l5eg5py9mfFOmfHLQOo2+X0IpPuaoxl0Nk73GzMKeyt8U qyVFMAik3TtATsxVoDn6iYAyG+0QTj+WttbpZZsPpcMqDXUfCpSf5a2PQsUosnAwIABP Voew== X-Gm-Message-State: APjAAAWOBPkDL8u7axEB/tjSHcmHtL/MI4cHUhGAuQOWysC5tH2btnRE Lz65zYRnn/8mgu4vILjQd3N+yH8GKADppINt4Os= X-Google-Smtp-Source: APXvYqwu0n+NG5eOpsXa0EgLCxaWqqhaATYOq2EvWVY5gMADVlETqxZAT980NkKKwapWGu2Tl2Xo1AKOUYh4umsLBwQ= X-Received: by 2002:ac2:5386:: with SMTP id g6mr12906559lfh.88.1552408582166; Tue, 12 Mar 2019 09:36:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 12 Mar 2019 12:36:10 -0400 Message-ID: To: Kalle Sommer Nielsen Cc: Larry Garfield , Internals Content-Type: multipart/alternative; boundary="000000000000161c270583e84a96" Subject: Re: [PHP-DEV] RFC Draft: Comprehensions From: chasepeeler@gmail.com (Chase Peeler) --000000000000161c270583e84a96 Content-Type: text/plain; charset="UTF-8" On Tue, Mar 12, 2019 at 10:12 AM Kalle Sommer Nielsen wrote: > Hi > > Den tir. 12. mar. 2019 kl. 15.49 skrev Chase Peeler >: > > Everything looks weird and "non-phpish" when it's new. OO constructs > weren't PHP-ish at first, because PHP didn't originally support OO. Imagine > "foreach" didn't exist in PHP and we were still using > while(list($key,$value) = each($arr)) syntax. > > > > I agree that some of the examples are a bit hard to read and understand > - but that's only because we haven't been exposed to them. > > What I mean here is that the lack of things like the parentheses makes > the code generally harder to read, imagine this for large > comprehensions as userland would certainly do things like that and you > end up with monstrosities of code that is less verbose than the > counter examples given in the RFC. I mean sure I could just rewrite a > comprehension with a lot of whitespace, but it kinda seem to defeat > the purpose of short circuited generators and I might as well just > write it the more verbose way. > > I've never liked "developers might use it wrong" as reason to not implement something, especially if hard to read/complex code is the worst impact to improper use. > I like the idea, just not the syntax because it has the potential > (along with short closures) to be annoying to read in the long run. > I understand that you are talking about the syntax (which others have said is still up for discussion) and not the feature itself. I still wanted to make the comment above more a general response to that line of thinking. > > -- > regards, > > Kalle Sommer Nielsen > kalle@php.net > -- -- Chase chasepeeler@gmail.com --000000000000161c270583e84a96--