Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84488 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33482 invoked from network); 9 Mar 2015 22:02:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Mar 2015 22:02:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.47 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.47 mail-pa0-f47.google.com Received: from [209.85.220.47] ([209.85.220.47:45834] helo=mail-pa0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 83/91-23562-D581EF45 for ; Mon, 09 Mar 2015 17:02:06 -0500 Received: by padbj1 with SMTP id bj1so42252802pad.12 for ; Mon, 09 Mar 2015 15:02:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=q0WSkoxRc2Ig+1MUiWqD4GOIqH2Fq8rBjX1Z+oTWYfE=; b=r3PrYz8sc5kza4OpMO31xbZt89/2zT5g+lNMs8LuQ4vWTd1esmlM/qHGTe14bL9NZt Fa/FaDPPQUn+OCgYg4iRn9glXbzEGJfr9z4LHcUTPmHD1gMj/u8aqAZq/n23RyS9NdsU ExAWBv4xpkKdx/xYj7hfy/l+P3MP6cIr5CVnTzYm9CHNF24cuCuGlzu4kIrSqXFk0QZd MYtYzJ/YgeRqFEnj8heVXYQVZ6cBQsV9I9IptRsExwnSLDJFYiA4HbbFWP+J0mUW38IX +NTBP32olPyPhB0QvCU1b4y/DqkkzWnCO0HHzeF8etVSLbrN4tmxU1jP8vCVoVCyp7hj 577Q== X-Received: by 10.66.66.166 with SMTP id g6mr58769582pat.88.1425938522669; Mon, 09 Mar 2015 15:02:02 -0700 (PDT) Received: from Stas-Air.local (tan1.corp.wikimedia.org. [198.73.209.1]) by mx.google.com with ESMTPSA id kn5sm20782896pdb.42.2015.03.09.15.02.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Mar 2015 15:02:01 -0700 (PDT) Message-ID: <54FE1858.3020107@gmail.com> Date: Mon, 09 Mar 2015 15:02:00 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Rowan Collins , Shawn McCool , internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Request Feedback for Instance Variable Sugar RFC From: smalyshev@gmail.com (Stanislav Malyshev) Hi! >> The problem with this is that it reduces expressiveness in the >> language and increases the amount of unnecessary decoration, >> reducing readability. > > I disagree with this premise. The $this here is not just decorative > syntax, it's an actual variable, which can be passed around just like > any other variable. The -> is then the standard way of accessing a > property or method, applied to that variable. Completely agree. The problem with going to far with overly "expressive" code - i.e. one that uses as little characters as possible - is that it becomes less and less comprehensible. $this-> is not too long to be any real problem (and if it's really that troublesome one always can code a macro in their editor). It is abundantly clear to both novice and seasoned programmer. It is a subclass of wider standard syntax (-> as member access). It has shared pattern for properties and methods, so you don't need to keep too many concepts in your mind to parse it. I don't think saving half-dozen characters is worth sacrificing all that. -- Stas Malyshev smalyshev@gmail.com