On 2-Jul-09, at 4:56 AM, Lukas Kahwe Smith wrote:
On 02.07.2009, at 10:45, Paul Biggar wrote:
to work in a future with a library/framework that is strict about
its input
or some far fetched idea that it will change the very nature of PHP.
I don't think we are worried about it changing PHP, or about
libraries
using strict type hints. We are worried that libraries will use no
hints, because the ones on offer are not useful to them.
I think he is replying to me here. I am worried that with Ilia's
proposal, people will strictly type everything, even where weakly
typed would suffice. The reason being that developers are lazy. With
these type "hints" (they are not actually hints, but "checks" as you
already made clear), they can very easily move the burden of type
juggeling explicitly to the user of their code.
At least in my world, I use a lot of 3rd party libraries, which will
then likely become essentially strictly typed. While strictly typing
can prevent bugs and all sorts of good stuff, we should be more
hesitant when it comes to giving people tools that make it easy
(encourage) to turn a core principle of PHP upside down.
First of all PHP is a tool, if some developers choose(!!) to adopt
stricter practices (which I doubt will happen), then perhaps its time
for the tool to change with them. As far as I know PHP is there to
solve problems and make it easy to do so, not support/enforce certain
programming paradigms.
I know that "numeric" was a concession to people with my concern
from the last discussion. But it doesnt cover all the bases of
types. In that vain Paul's proposal does indeed provide a syntax
that at least enables both approaches. More importantly it proposes
a syntax that requires the same number of characters for both
approaches. You might laugh at this comment, but I believe that the
overuse of "private" that I am seeing has a lot to do with the fact
that its shorter than "protected".
Paul's proposal is some part does not make sense because it allows
weak type hinting, which should not be used if you need type hinting.
The whole idea about type hinting is definition of strict interfaces,
not loosely based one. That's just my opinion, which admittedly I feel
fairly strongly about.
Ilia
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php