> Please don't top post. This is a bottom-post-centric list.
Can you please tell me what mailing client you use and what should I?
> if we were designing the language today we would do it very differently.
This reminds me working with legacy code in the team which says to write
the code in the style in which the project is written.
You are trying to make your code more maintainable and readable, decompose
your functionality, define clear pre and post conditions.
Then comes time for code review and teamlead orders you to throw everything
away and write the same legacy as they do because project is written this
way.
PS. No more do I work in this team.
Can you please explain what prevents us from doing the best (like if we
were designing the language today) for new features now?
1) Dollars in PHP
> Variables in PHP always begin with $. For all time, Always.
Yes, but let's not confuse variables (which by definition can be rewritten)
with values that can get it's value only once.
Almost every time we encounter $ sign in PHP, we can change it's value
either as a $property or $variable.
All the time we encounter "immutable descriptor for value" (fancy name for
not-variable) without dollar sign, it can't be changed. I am talking about
constants.
2) Object constants
> Objects do not have constants. Classes have constants.
Yes, objects do not have constants, but may have `readonly` properties
which use constant-like syntax because they can't be ever changed. I don't
understand why you name it constants if it is not.
> Introducing object-level constants is potentially confusing.
Yes, introducing constants may be confusing. Introduction of `readonly`
properties with dollarless syntax is very logical.
3) Constants and Properties
> Constants shouldn't be set even once. Properties can be, but properties
have $ on them.
Again, dollar sign is used for mutable value descriptors.
Constants don't have dollar sign and are not overwritable.
Readonly properties should not have dollar sign because they are not
overwritable as well.
4) Reflection part doesn't seem to be complicated here
> Are they still properties according to reflection, or are they something
else?
According to reflection, these are properties.
> What would reflection do with these object constants?
The reflection part should remain the same as it is with current RFC so
that `ReflectionProperty::isReadOnly` is added as well as `IS_READONLY`
flag added to the modifiers list.
> Can I enumerate mutable properties and constant properties together or
separately?
Why would you need to enumerate them separately? All of them are properties
by definition.
> Having very subtly different syntax for a very significant behavioral
difference in properties seems like a landmine waiting to happen that would
only confuse people.
We are in the programming world. In PHP if someone gets undermined, he will
know what he did wrong right in a few seconds. After blowing up (if this
will ever happen), programmer will write the code with understanding how
and why it works this way.
On Fri, Jul 16, 2021 at 7:14 PM Larry Garfield <larry@garfieldtech.com>
wrote: