On Sun, Mar 15, 2020, at 8:48 AM, Marco Pivetta wrote:
> Hey Máté,
> 
> On Sun, Mar 15, 2020, 14:04 Máté Kocsis <kocsismat...@gmail.com> wrote:
> 
> > Hi Marco,
> >
> > Yes, it still allows default values.
> >
> > The reason why I'm reluctant to disallow them is that this restriction
> > would feel a bit ad-hoc for me. I mean, I wouldn't like to add another
> > special rule for "write-once" properties, unless there is a strong
> > argument for it. Besides, as far as I know there is no precedents of
> > disallowing default values of similar properties in other languages,
> > so I feel that the feature would stay the most intuitive as it is now.
> >
> 
> I think what will happen is that people will start requesting for read-only
> properties with default values to be over-writable-once (a mess): better to
> remove them from the equation completely, no?

My concern is that if a readonly property can have a default value which is not 
overwriteable, then it's conceptually isomorphic to a class constant.  That 
will lead to ample questions and debates about whether you should use a class 
constant or a read-only property, or when you should use one or the other.  I 
foresee numerous bikeshed debates about that, which will only lead to thousands 
of hours of lost time debating something that shouldn't exist.

Avoiding that confusion will save the industry millions of dollars.

--Larry Garfield

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

Reply via email to