Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92853 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57060 invoked from network); 27 Apr 2016 21:35:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Apr 2016 21:35:26 -0000 Authentication-Results: pb1.pair.com header.from=michal@brzuchalski.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=michal@brzuchalski.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain brzuchalski.com designates 188.165.245.118 as permitted sender) X-PHP-List-Original-Sender: michal@brzuchalski.com X-Host-Fingerprint: 188.165.245.118 ns220893.ip-188-165-245.eu Received: from [188.165.245.118] ([188.165.245.118:50039] helo=poczta.brzuchalski.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F1/BC-20013-89031275 for ; Wed, 27 Apr 2016 17:35:22 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by poczta.brzuchalski.com (Postfix) with ESMTP id 3E33129841C4 for ; Wed, 27 Apr 2016 23:35:17 +0200 (CEST) Received: from poczta.brzuchalski.com ([127.0.0.1]) by localhost (poczta.brzuchalski.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aHKpVwDstbHR for ; Wed, 27 Apr 2016 23:35:10 +0200 (CEST) Received: from mail-lf0-f41.google.com (unknown [209.85.215.41]) by poczta.brzuchalski.com (Postfix) with ESMTPSA id D95B2298420D for ; Wed, 27 Apr 2016 23:35:09 +0200 (CEST) Received: by mail-lf0-f41.google.com with SMTP id y84so64421203lfc.0 for ; Wed, 27 Apr 2016 14:35:09 -0700 (PDT) X-Gm-Message-State: AOPr4FX16CkfySNYKjkx804JTBBwYMzaaKo09Jx5oi2VHSWN+4UiQpzVaxOcfZAGjnpI4i3oBFreliYkAXGraw== MIME-Version: 1.0 X-Received: by 10.25.28.140 with SMTP id c134mr3648101lfc.99.1461792909351; Wed, 27 Apr 2016 14:35:09 -0700 (PDT) Received: by 10.25.18.155 with HTTP; Wed, 27 Apr 2016 14:35:09 -0700 (PDT) In-Reply-To: References: <57211D05.6020002@fleshgrinder.com> Date: Wed, 27 Apr 2016 23:35:09 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Niklas Keller Cc: PHP Internals List Content-Type: multipart/alternative; boundary=001a11472c0018e29705317e2ff5 Subject: Re: [PHP-DEV] [RFC] PHP Annotations VS Attributes From: michal@brzuchalski.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=) --001a11472c0018e29705317e2ff5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2016-04-27 22:53 GMT+02:00 Niklas Keller : > Fleshgrinder schrieb am Mi., 27. Apr. 2016 22:11: > > > I am writing this in a separate thread because of the urgency that I se= e > > regarding the naming of past, current, and future proposals regarding > > this functionality. > > > > It was and is proposed to create this feature with the name *Attributes= * > > as Facebook did in their Hack language. Main argument is to blindly > > follow /because/. > > > > On 4/25/2016 10:31 AM, Dmitry Stogov wrote: > > > Different languages names this differently. > > > I may add an additional voting question - "annotation vs attributes?"= . > > > > > > > It is true and only natural that different languages choose different > > names for equivalent features but this discussion is not about taste, > > style, nor coolness. It is about natural language, proper computer > > science terminology, and what PHP users will search for in search > > engines. I already tried to explain this in the actual thread but I > > guess my attempts resulted in more confusion than clarification, let me > > try again. > > > > #### ATTRIBUTE #### > > > > The word *attribute* has several meanings in computer science and this > > is mainly due to its extremely generic nature: > > > > > a usually good quality or feature that someone or something has > > > > > > --- http://www.merriam-webster.com/dictionary/attribute > > > > > In computing, an attribute is a specification that defines a property > > > of an object, element, or file. [...] For clarity, attributes should > > > more correctly be considered metadata. An attribute is frequently and > > > generally a property of a property. > > > > > > --- https://en.wikipedia.org/wiki/Attribute_%28computing%29 > > > > This pretty much sums it up already. An attribute is the metadata that > > is attached to an element of source code. This metadata is anything > > unessential that is additionally added but not necessarily required. > > > > class A { > > var $x; > > } > > > > The `class` and `var` keywords are essential in this example and define > > the actual element and the names are required too. > > > > public final class A { > > private static int $x =3D 42; > > } > > > > Class A has the attributes `public` and `final`. > > Property `$x` has the attributes `private`, `static`, `int`, and `42`. > > > > All of these attributes of the class and the property add additional > > metadata to the source code elements that define their qualities or > > features and consequently their behavior and usage. > > > > http://www.onelook.com/?w=3Dattribute&ls=3Da > > http://encyclopedia2.thefreedictionary.com/attribute > > > > Sebastian Bergmann already explained this but I think it is important t= o > > be repeated and further clarified. The word attribute is often used to > > refer to properties with additional metadata (e.g. access modifiers, > > default values, ...; illustrated above) in an OO context. This makes th= e > > usage of the word attribute additionally to its generic nature ambiguou= s > > as well: > > > > https://en.wikipedia.org/wiki/Attribute_%28computing%29 > > > > http://encyclopedia2.thefreedictionary.com/instance+attribute > > https://en.wikipedia.org/wiki/Instance_variable > > > > http://encyclopedia2.thefreedictionary.com/static+attribute > > https://en.wikipedia.org/wiki/Static_variable > > > > *All* userland implementations that are called /attributes/ in the free > > and open world deal with completely different things: > > > > https://packagist.org/search/?q=3Dattribute > > > > Last but not least, Perl has /attribute/ support. However, Perl actuall= y > > uses it for interaction with *all* attributes that can be set. Hence, > > this is what attributes really do. > > > > http://perldoc.perl.org/attributes.html > > > > #### ANNOTATION #### > > > > > Extra information associated with a particular point in a document or > > > program. Annotations may be added either by a compiler or by the > > > programmer. They are not usually essential to the correct function of > > > the program but give hints to improve performance. > > > > > > --- http://encyclopedia2.thefreedictionary.com/annotation > > > > http://www.onelook.com/?w=3Dannotation&ls=3Da > > > > The term *annotation* is not only used by Java: > > > > https://packagist.org/search/?q=3Dannotation > > > > https://en.wikipedia.org/wiki/Annotation > > https://en.wikipedia.org/wiki/Ruby_character > > https://en.wikipedia.org/wiki/Java_annotation > > > > https://msdn.microsoft.com/en-us/library/dd901590%28VS.95%29.aspx > > http://docs.scala-lang.org/tutorials/tour/annotations.html > > https://kotlinlang.org/docs/reference/annotations.html > > https://www.python.org/dev/peps/pep-3107/ > > https://ghc.haskell.org/trac/ghc/wiki/Annotations > > http://ceylon-lang.org/documentation/1.2/tour/annotations/ > > > http://clojure-doc.org/articles/ecosystem/core_typed/start/annotations.ht= ml > > https://www.dartlang.org/effective-dart/style/ > > ... > > > > https://rubygems.org/search?utf8=3D%E2%9C%93&query=3Dannotation > > http://rustbyexample.com/scope/lifetime/explicit.html > > https://www.google.de/search?q=3Djavascript+annotation > > ... > > > > Ignoring these facts just because Facebook did not do proper research i= s > > a total no go. It is also not up for a vote, it is just proper English > > and computer science terminology! > > > > Last but not least, it also ensures that users find the correct PHP > > manual page when they search for this new feature that might make it > > into core at some point. :) > > -- > > Richard "Fleshgrinder" Fussenegger > > > > I agree with all of that, +1. > > > > Hi, personally I prefer Annotation word instead of Attributes because of my language (Polish) discrepancies in usage as "class attribute" in Polish means quite the same as "object property" in English and may came to missusage of that name - this info is also on Wikipedia https://pl.wikipedia.org/wiki/Atrybut_(programowanie)#Poj.C4.99cie_atrybutu= _w_programowaniu_obiektowym Annotation in Polish in Software Development is uniquely associated with the Attributes in your meaning exactly the same as Java Annotaitons and this is clearly understood for eg. Cay S. Hortsmann in "Java 8" in translation into Polish is talking about Annotations. For eg. in Symfony docs translation into Polish http://symfony-docs.pl/bundles/SensioFrameworkExtraBundle/index.html also is usage of Annotation (Ctrl+F "adnotacje") - this is official documentation. Thats why IMHO Annotation name should be retained. Thanks, Regards, -- Micha=C5=82 Brzuchalski --001a11472c0018e29705317e2ff5--