Re: Inline typecasting / typehinting for classes and interfaces
| From: | Stas Malyshev | Date: | Wed, 15 Aug 2012 08:36:26 +0000 |
| Subject: | Re: Inline typecasting / typehinting for classes and interfaces | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-62171@lists.php.net to get a copy of this message | ||
Hi!
> Let me ask you - do you think the existing PHP typehints are pointless too?
> Do you feel they don't give you enough flexibility? Do you feel they
> reinvented a language construct for the purpose of saving the typing of one
> if clause (per argument) (per method) (per class)?
They are not pointless, but I think they are often misunderstood and not
used correctly. And they definitely lack flexibility in many cases. But
they are helpful for one important thing - defining interface between
the method and the method client. Having strictly typed variables does
not serve it, and trying to make PHP into half-baked
half-statically-typed language does not sound like a good idea to me.
> And why do you keep ignoring the fact that IDE's need additional clutches to
> understand the type of the variable?
Because I don't think inventing language constructs for the purpose of
helping IDEs simulate static typing in dynamically typed language makes
much sense.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227