Hello everyone,
(Un)fortunately I do not have voting rights, but here is my (freely expressed) 50 cents anyways:
I appreciate that Andrea is trying to come up with a one-size-fits-all RFC. Nevertheless I believe it is flawed in regards to content as well as formally in terms of voting options.
In my view this has become a fight over feature request vs. language consistency. I understand that a large part of userland is or would be in favor of this RFC - they always prefer new features as long as they are backward compatible. You might as well introduce an (configuration/declare) option for static typing, and userland would probably cheer. This does not necessarily make it a good thing though.
You, @internals, are the guardians of this language and should consider intrinsic language consistency as a paramount objective. At the end of the day PHP is fundamentally a weakly typed language. Introducing an optionality in how the fundamental semantics of the language work (with the declare-proposal) is not well thought trough. It is by all means quite hacky - reminds me of register-globals, mb-function-overloading, etc. - everything bad about PHP. As we all know bad things cannot be revoked easily once introduced.
This doesn't mean strict type hinting cannot be done in a coherent way. There have been good (or at least compatible) proposals, e.g. seeing "(type)" as a weak hint and "type" as a strict hint. This would be somewhat consistent with both, casting expressions as well as the existing strict/strong type hints for objects. But maybe having both is not the right (PHP) way after all. The only thing 100% consistent with the current language semantics would be no type hinting at all or some form of weak type hinting. Everything else would be nice to have, if (and only if) done right.
Ultimately, and I am sorry to say that, I think this discussion is symptomatic for the lack of professionalism among the PHP community, keeping many potential contributors (like my colleagues and myself) from actually committing resources apart from mere observation. I find it very discouraging that well argued opinions of lead developers of this project, such as Andi, Rasmus and Zeev, are dismissed so bluntly. I do not recall any instance in the PostgreSQL community where Tom Lane or some other senior contributor has been so harshly treated. Having the original designers of the language keenly reject this proposal should be a concern to all of us, independently of subjective opinion or the current voting result.
The honorable (and rational) thing to do would be for the author to retract this RFC and thereby postpone the decision (I am aware that the feature freeze looms!). This is so important for the future of PHP, so let's don't rush it, but try to do it right!
Cheers,
Ben
========== Original ==========
From: Matthew Leverton leverton@gmail.com
To: Zeev Suraski zeev@zend.com
Date: Mon, 09 Feb 2015 05:20:25 +0100
Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints
I'm well aware of it as I wrote that policy. The goal of the policy was to
prevent a situation where a temporary majority can introduce features into
the language that would later on be impossible to reverse. It's not by any
stretch a good mechanism to solve controversial votes, which again, should
ideally be avoided as much as possible. It's just that there isn't a better
mechanism.
I know I'm unfairly paraphrasing you, but it sounds like you are
saying that for things that you don't have strong feelings about, then
you're fine if the others vote amongst themselves. But for things that
matter to you, you want to reserve the right to prevent change. Is
there a way to fairly describe what you consider too controversial to
vote on?
The problem I see with votes for this type of feature is that you
probably have a breakdown of something like:
- 10% of people don't want scalar type hints
- 20% of people want both, but 50% of them would vote for either weak or strong
- 35% of people want strict, but 80% of them are fine with weak
- 35% of people want weak, but 80% of them are fine with strong
So if a strict-only vote happens first, you get 73% to say yes. If
weak-only vote happens first, you get 73% to say yes.
(I'm obviously just making up these numbers with no scientific basis,
but I think the principle is valid.)
The only way to be fair IMO is to hold a vote where you rank those
four options (weak, strong, both, neither) and hold an instant run-off
vote where the first majority wins. And if 'neither' wins, then agree
that the topic cannot be revisited until next major version, so that
everybody can rest for 5 years. ;)
--
Matthew Leverton