> -----Original Message-----
> From: Fleshgrinder [mailto:p...@fleshgrinder.com]
> Sent: Sunday, April 24, 2016 2:49 PM
> To: Zeev Suraski <z...@zend.com>; Sebastian Bergmann
> <sebast...@php.net>
> Cc: internals@lists.php.net
> Subject: Re: [PHP-DEV] [RFC] PHP Attributes
> 
> On 4/24/2016 1:00 PM, Zeev Suraski wrote:
> >
> >
> >> -----Original Message-----
> >> From: Sebastian Bergmann [mailto:sebast...@php.net]
> >> Sent: Sunday, April 24, 2016 12:14 PM
> >> To: internals@lists.php.net
> >> Subject: Re: [PHP-DEV] [RFC] PHP Attributes
> >>
> >> On 04/21/2016 11:13 PM, Dmitry Stogov wrote:
> >>> I would like to present an RFC proposing support for native annotation.
> >>
> >> Dmitry,
> >>
> >> please use "annotation" as the name for this feature and not "attribute".
> >>
> >> We already have attributes: it's what we use to store data in
> >> objects. And while some people call them "member variables" or
> >> "properties" the correct term for them (AFAIK) is "attribute".
> >
> > I don't think I've ever heard properties referred to as attributes in the
> context of PHP.  The PHP manual defines them and refers to them throughout
> as 'properties'.
> >
> > (I'm not voicing an opinion on attributes vs. annotations;  Just pointing 
> > out
> that data storage inside objects isn't named attributes).
> >
> > Zeev
> >
> 
> The terminology here is pretty clear and you can just look it up, it has 
> nothing
> to do with PHP or Java or whatever. The main problem is simply that people
> do not know the terminology and get mixed up. That is usually okay in a
> casual discussion where each peer understands what the other is referring to.
> However, we are dealing with language specification here and need to be very
> exact or we fuck it up for the users.
> 
> `$x` is a property in the following example:
> 
>   class A {
>     $x;
>   }
> 
> https://en.wikipedia.org/wiki/Property_%28programming%29

Richard,

Thanks for the programming 101 lesson :)

I pointed out to Sebastian, who suggested that 'attributes' are equivalent to 
'member variables' or 'properties', that they're very consistently referred to 
in PHP as 'properties' and that I'm not aware that they were ever referred to 
as 'attributes'.

Nothing in your links suggested otherwise, arguably the opposite.  According to 
https://en.wikipedia.org/wiki/Attribute_(computing), "An attribute is 
frequently and generally a property of a property", and while "the term 
attribute can and is often treated as equivalent to a property depending on the 
technology being discussed", when the technology in question is PHP, this is 
not the case.

Of course, member visibility modifiers and access modifiers 
(public/protected/private, static, etc.) are a different thing.  Saying member 
variables are referred to as attributes (incorrect in the context of PHP, 
AFAIK) is very different from saying these modifiers are referred to as 
attributes (correct and sensible).

Last, we're absolutely allowed to have our own definitions of terms as long as 
they're sensible.  Both attributes and annotations are sensible here, and the 
fact there may be languages that treat attributes as equivalent to properties 
isn't a strong reason against using that term for something sensible, that is 
different from these other languages, in PHP.

Zeev


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

Reply via email to