> -----Original Message-----
> From: Andrea Faulds [mailto:a...@ajf.me]
> Sent: Thursday, January 15, 2015 4:10 PM
> To: Zeev Suraski
> Cc: rquadl...@gmail.com; Leigh; PHP Internals List
> Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2
>
> Hi Zeev,
>
> Whether or not they are in the majority, a very large portion of PHP
> developers would prefer strict typing. In particular, the most vocal ones
> would seem to. There are also a lot of PHP developers who would prefer
> weak typing. Thus we have a problem: either approach to scalar hints will
> upset a large portion of the community.

That's correct.  As I said though, the source of the opposition is
fundamentally different.
The camp which opposes weak typing opposes it based on the idea that it
doesn't behave in the way that would suit their needs.
The camp which opposes strict typing - which incidentally includes most of
the people who originally created the language - opposes it based on the
assertion that it goes against the spirit of the language.  That is equally
true for the v0.2 proposal you've just submitted.

> > How do you deduce that 'nobody uses them' from the fact that some
> > group of people said they won't?  I'm sorry, but it makes no sense,
> > especially given the positive feedback you saw on internals, making it
> > clear that there would be in fact people using it.
>
> Not all of it was positive. Sure, a lot of people would use them though,
> but
> I’ve heard quite a few developers say they wouldn’t use them and continue
> to use manual (!is_int($foo))-style assertions.

Of course not all of it was positive, but it was overwhelmingly positive.
Very few opposed.  Someone saying they won't use it doesn't count as
opposition.  You see, PHP exists for 15-20 years now.  There aren't any
must-have features that aren't in it.  No single feature we add will be used
by everyone, and people telling us they won't use this feature shouldn't
'deter' us in any way.

> > If there's one thing that's worse than introducing an alien concept
> > like strict typing into PHP, it's introducing it as a feature that
> > will include all the negatives of this alien concept, PLUS have the
> > ability to radically change how it behaves based on a runtime option.
>
> This isn’t a runtime option, it is entirely compile-time. Much like
> namespaces
> are not a runtime option. There isn’t even the ability to toggle it at
> runtime,
> unless we somehow add some ability to edit the flags on individual
> opcodes.

Compile time and runtime in PHP are intertwined when you factor in
cross-file interaction.

Zeev

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

Reply via email to