Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92850 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51269 invoked from network); 27 Apr 2016 20:53:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Apr 2016 20:53:53 -0000 Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.221 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.221 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.221] ([81.169.146.221:38077] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 31/AB-20013-ED621275 for ; Wed, 27 Apr 2016 16:53:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1461790427; l=15155; s=domk; d=kelunik.com; h=Content-Type:To:Subject:Date:From:In-Reply-To:References: MIME-Version; bh=jBGCiLgMN4QQl8gl2+pAkCO6/7R7nDJURzsueL9lQ4o=; b=S8DO9pIK0gAeyipuN+5QZYlUMlzHqipuYzAMOxf1ECMN3W9/sDmSrYwR+13a2JIasOf CEOxTzh/dmBqMHMTEdTmVhPTf3BZluXDhW/nyJmKW7mkFnVlzLfbWvPGBXRcEnXxcW8wq m3ELgY1ci4XXEGOet2sXJcpCs0OvXH7IReU= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLGvomb4bl9EfHtO3I6 X-RZG-CLASS-ID: mo00 Received: from mail-wm0-f41.google.com ([74.125.82.41]) by smtp.strato.de (RZmta 37.24 AUTH) with ESMTPSA id J05d03s3RKrlETz (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp384r1 with 384 ECDH bits, eq. 7680 bits RSA)) (Client did not present a certificate) for ; Wed, 27 Apr 2016 22:53:47 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id a17so33631243wme.0 for ; Wed, 27 Apr 2016 13:53:47 -0700 (PDT) X-Gm-Message-State: AOPr4FUqhYGToSGYxhwaDT37InfV50Bry85ETwcF8rcZgdKigsI8mxqZudX1+syz6ufNeSy9ceWdgNxDiBduow== X-Received: by 10.194.87.103 with SMTP id w7mr11400589wjz.13.1461790427444; Wed, 27 Apr 2016 13:53:47 -0700 (PDT) MIME-Version: 1.0 References: <57211D05.6020002@fleshgrinder.com> In-Reply-To: <57211D05.6020002@fleshgrinder.com> Date: Wed, 27 Apr 2016 20:53:37 +0000 X-Gmail-Original-Message-ID: Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=047d7bf10b542a039305317d9b61 Subject: Re: [PHP-DEV] [RFC] PHP Annotations VS Attributes From: me@kelunik.com (Niklas Keller) --047d7bf10b542a039305317d9b61 Content-Type: text/plain; charset=UTF-8 Fleshgrinder schrieb am Mi., 27. Apr. 2016 22:11: > I am writing this in a separate thread because of the urgency that I see > 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 = 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=attribute&ls=a > http://encyclopedia2.thefreedictionary.com/attribute > > Sebastian Bergmann already explained this but I think it is important to > 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 the > usage of the word attribute additionally to its generic nature ambiguous > 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=attribute > > Last but not least, Perl has /attribute/ support. However, Perl actually > 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=annotation&ls=a > > The term *annotation* is not only used by Java: > > https://packagist.org/search/?q=annotation > > 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.html > https://www.dartlang.org/effective-dart/style/ > ... > > https://rubygems.org/search?utf8=%E2%9C%93&query=annotation > http://rustbyexample.com/scope/lifetime/explicit.html > https://www.google.de/search?q=javascript+annotation > ... > > Ignoring these facts just because Facebook did not do proper research is > 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. > --047d7bf10b542a039305317d9b61--