Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87120 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95640 invoked from network); 12 Jul 2015 16:17:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jul 2015 16:17:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=marcio.web2@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=marcio.web2@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.179 as permitted sender) X-PHP-List-Original-Sender: marcio.web2@gmail.com X-Host-Fingerprint: 209.85.160.179 mail-yk0-f179.google.com Received: from [209.85.160.179] ([209.85.160.179:33293] helo=mail-yk0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 55/93-23914-A0392A55 for ; Sun, 12 Jul 2015 12:17:15 -0400 Received: by ykeo3 with SMTP id o3so177437411yke.0 for ; Sun, 12 Jul 2015 09:17:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=Swz+3AlyTIuOcOw3LAoIrfYl/6yyl1bldgVs3jiHinM=; b=Djv5md/E9D4mAspS9CNM3hqaJiSURGJ7/ybkX8Jpij+FgZrZJx7kC2RxQQO9FY5ASa ggX2LE7lJRM2V88AUZcC06DF0RSQprSqHt5d1s9Q2dNlgXOFuC7EZ/xpRXRVHBHeczVh bseOCIHo83qP5aFVrOrrzLW0URWLhQB/QBxbNJyZ/+WmJ8HmdwIju7dxNkekCU8bmo80 dM7TMm4p3U7DPBhv0XJFdOCzOY1SWp/0hKArazHLL/yTZApAVaaV0sNgPO4lBO9FN0Sa ABdk5uig6tyGGIRUnvFL1rll/GfrlRy+pOhITgyT1HEIWGq69z6au7YAw3wLsv3Y+o7U VSFA== X-Received: by 10.170.206.139 with SMTP id x133mr34289896yke.126.1436717832368; Sun, 12 Jul 2015 09:17:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.36.7 with HTTP; Sun, 12 Jul 2015 09:16:53 -0700 (PDT) In-Reply-To: <55A220D8.3090004@gmail.com> References: <55A16375.4000707@php.net> <55A220D8.3090004@gmail.com> Date: Sun, 12 Jul 2015 13:16:53 -0300 Message-ID: To: Stanislav Malyshev Cc: Sebastian Bergmann , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] PHP7 and types From: marcio.web2@gmail.com (Marcio Almada) Stas, 2015-07-12 5:10 GMT-03:00 Stanislav Malyshev : > Hi! > >> Not completely bogus. At least with typed properties you won't need to >> actually write the docblocks to have the IDE "hints". It's a minor win >> for IDE users too. > > I don't see "not needing to write docblocks" as a win, quite the > contrary. Of course it's a win. Or do you like to write docblocks for every single class property or method (even when the member is obvious) just to have a "@var" so your IDE can work? Not to mention you won't get any runtime/compile time check or optimization from docblock tags, that's the main point of having typed properties. > In fact, in a number of projects I worked with, code without > proper documentation (including docblocks) simply wasn't accepted into > the repository. > If you are using the term "proper documentation" to justify docblocks everywhere even if they contain just a "/** @var string */", it's a sign we've been using comments against us all this time (even if we called it "doc comments"). But thankfully we are moving PHP to another direction. Do you remember the "return types" voting results? https://wiki.php.net/rfc/return_types#vote. That's because "function() : type" is self documented and much more maintainable than than a possibly sloppy "/** @return type */" on top of every method on a codebase. > While I don't think this needs to be mandatory, I also don't see major > difference - so you have to write type instead of docblock, you still > have to write something. > But with the benefits already cited above. Docblocks should not be a place for type information anymore, this was a workaround and we've been slowly replacing it with a better solution (opt in types). Property types seems to be the next logical step after adding return types and scalar types. > -- > Stas Malyshev > smalyshev@gmail.com Is there any technical reason for you to be against typed properties? IMMO, just arguing against opt in type declarations (evolving the php type system) in favor of docblocks (stagnation) seems to be utterly unproductive as we already know the tendencies from previous votings. Marcio