Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58392 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87215 invoked from network); 1 Mar 2012 08:47:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Mar 2012 08:47:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=simonsimcity@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=simonsimcity@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.214.170 as permitted sender) X-PHP-List-Original-Sender: simonsimcity@googlemail.com X-Host-Fingerprint: 209.85.214.170 mail-tul01m020-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:50899] helo=mail-tul01m020-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FE/1C-46815-1A73F4F4 for ; Thu, 01 Mar 2012 03:47:31 -0500 Received: by obbwd1 with SMTP id wd1so443690obb.29 for ; Thu, 01 Mar 2012 00:47:26 -0800 (PST) Received-SPF: pass (google.com: domain of simonsimcity@googlemail.com designates 10.182.222.74 as permitted sender) client-ip=10.182.222.74; Authentication-Results: mr.google.com; spf=pass (google.com: domain of simonsimcity@googlemail.com designates 10.182.222.74 as permitted sender) smtp.mail=simonsimcity@googlemail.com; dkim=pass header.i=simonsimcity@googlemail.com Received: from mr.google.com ([10.182.222.74]) by 10.182.222.74 with SMTP id qk10mr1538964obc.75.1330591646231 (num_hops = 1); Thu, 01 Mar 2012 00:47:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=byajpms7VJCVqZPtDcYmGxXNeBnHde+7ZwgNyGDOKBI=; b=TJD4cdioHnEytOE5HuGXWyTtlVuUn9mYB/jTIW0rigLrQYTDgB/K9raoGrqNzNVBLR pOABu4DCLY+94+aO3WGMWqQ+mrHZf3zN8skJldL60elLg5A3bro6B0UilW+YNOnruFJ1 ZwIwe1j7aTyttPhjjBhuX1zrcpIXPeoea2Frc= MIME-Version: 1.0 Received: by 10.182.222.74 with SMTP id qk10mr1322433obc.75.1330591646151; Thu, 01 Mar 2012 00:47:26 -0800 (PST) Received: by 10.60.7.229 with HTTP; Thu, 1 Mar 2012 00:47:26 -0800 (PST) In-Reply-To: References: <4F4EE0C0.1050302@php.net> Date: Thu, 1 Mar 2012 09:47:26 +0100 Message-ID: To: Adam Jon Richardson Cc: Sebastian Bergmann , internals@lists.php.net Content-Type: multipart/alternative; boundary=f46d04447efd68f30704ba2a8230 Subject: Re: [PHP-DEV] Scalar Type Intentions From: simonsimcity@googlemail.com (Simon Schick) --f46d04447efd68f30704ba2a8230 Content-Type: text/plain; charset=UTF-8 Hi, Adam I just get the feeling that this is exactly what we're currently discovered in some other threads in this mailing-list. We're now getting more and more closer to what we really want and a good way to write it the PHP-way. Please try to get a rough overview over the last messages we wrote on the following threads: * [PHP-DEV] PHP Philosophy (was RE: [PHP-DEV] Scalar type hinting) * RE: [PHP-DEV] Scalar type hinting The second one is quite big ;) and sometimes the messages contain only religious stuff like "This will never be, go away" - but that's just because we're in discussion. Like the wind blows. But I think we'll get to list of rock-solid possible solutions here. I think we'll soon create a RFC for that and discuss it after we have it "on one paper". I would kind-of like the idea to add the *scalar *type in addition just to avoid objects or arrays in there, but let's look how the discussion goes. Bye Simon 2012/3/1 Adam Jon Richardson > First, phpunit is a fantastic tool! I'm thankful for your contributions to > all of the PHP community (especially with the code coverage capabilities.) > > I speak to your 2 points inline below: > > On Wed, Feb 29, 2012 at 9:36 PM, Sebastian Bergmann >wrote: > > > On 02/29/2012 09:01 PM, Adam Jon Richardson wrote: > > > >> However, the aliases would allow developers to better communicate > >> intentions AND provide more information for IDE's and static analyses > >> tools. > >> > > > > 1) You are trying to solve a social problem through technology. That > > usually does not work. > > > > I believe technology can provide effective tools for social problems, > although I won't go so far as to say that it usually does work. More > importantly, I believe programming is riddled with social problems: > > "Let us change our traditional attitude to the construction of programs. > Instead of imagining that our main task is to instruct a computer what to > do, let us concentrate rather on explaining to human beings what we want a > computer to do." > > D. Knuth > > 2) What you want to achieve is already possible through docblocks. > > > The greater part of the proposal rests on the general scalar hint. That > said, I still believe the aliases for the scalars hold value. Sure, the > communicative aspect of the aliases can be achieved through use of > docblocks. However, in cognitive psychology and human factors research, > proximity of relevant information plays a role in perception and > processing, and I would posit that code with the type intentions displayed > closer to the actual body of the function would hold benefits (this would > be very testable, though, and research could prove me wrong.) When > available, the scalar aliases could then be used to help auto-generate the > docblocks. > > I would appreciate the scalar hinting, along with the aliases I outlined > very much in my code. I believe that this form of hinting stays true to the > PHP principles outlined in Richard's PHP Philosophy thread (a great read), > and I believe it helps developers who want to better enforce (scalar > hinting) and communicate (scalar aliases) the intentions of their code. > > Thank you for the feedback, > > Adam > --f46d04447efd68f30704ba2a8230--