Stas,

2015-07-12 5:10 GMT-03:00 Stanislav Malyshev <smalys...@gmail.com>:
> 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
> smalys...@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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to