Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92897 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85615 invoked from network); 28 Apr 2016 19:21:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Apr 2016 19:21:17 -0000 Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 77.244.243.87 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.87 mx106.easyname.com Received: from [77.244.243.87] ([77.244.243.87:52652] helo=mx201.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B0/1C-28296-BA262275 for ; Thu, 28 Apr 2016 15:21:16 -0400 Received: from cable-81-173-133-226.netcologne.de ([81.173.133.226] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1avrUu-0004Rq-8i; Thu, 28 Apr 2016 19:21:12 +0000 Reply-To: internals@lists.php.net References: <57211D05.6020002@fleshgrinder.com> <57224957.8090504@fleshgrinder.com> <5d8ef1e6-1d08-bf12-b481-4f72af3f6dd9@gmail.com> To: Rowan Collins , internals@lists.php.net Message-ID: <5722629A.4050001@fleshgrinder.com> Date: Thu, 28 Apr 2016 21:20:58 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <5d8ef1e6-1d08-bf12-b481-4f72af3f6dd9@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ATOV23E6lI4qBO7DM02lOq0SciCmtU0Om" X-ACL-Warn: X-DNSBL-BARRACUDACENTRAL Subject: Re: [PHP-DEV] [RFC] PHP Annotations VS Attributes From: php@fleshgrinder.com (Fleshgrinder) --ATOV23E6lI4qBO7DM02lOq0SciCmtU0Om Content-Type: multipart/mixed; boundary="IvGwnKluOuHuPJ2DIGOgdNnNwpQ6OTacl" From: Fleshgrinder Reply-To: internals@lists.php.net To: Rowan Collins , internals@lists.php.net Message-ID: <5722629A.4050001@fleshgrinder.com> Subject: Re: [PHP-DEV] [RFC] PHP Annotations VS Attributes References: <57211D05.6020002@fleshgrinder.com> <57224957.8090504@fleshgrinder.com> <5d8ef1e6-1d08-bf12-b481-4f72af3f6dd9@gmail.com> In-Reply-To: <5d8ef1e6-1d08-bf12-b481-4f72af3f6dd9@gmail.com> --IvGwnKluOuHuPJ2DIGOgdNnNwpQ6OTacl Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 4/28/2016 8:02 PM, Rowan Collins wrote: > Interesting; do you have a link to where this terminology is explained?= > Most of the articles I've seen just refer to "attributes", and the link= > you have doesn't really explain that at all, it has namespaces with > "annotation" in the name, but uses the word "attribute" everywhere in > the actual text. >=20 Yes, I provided many in the initial message, the Wikipedia link [1] explains it in detail and you may use it as reference for all the other questions you have here, since it answers all of them. Emphasize mine: > You can also use *attributes* to control memory placement, code > generation options or call/return conventions within the function > being *annotated*. > > --- https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html We /annotate/ data and by doing so we add /attributes/. The C language is a very good example where all attributes are directly called attributes because there is no other system available to add attributes. In PHP we have various means to add attributes, so does Java. *That* is why it is not a good idea to call a specific functionality /attributes/. On 4/28/2016 8:02 PM, Rowan Collins wrote: > According to this page, the syntax which applies an attribute to some > code is called an "attribute specification": > https://msdn.microsoft.com/en-us/library/aa664616.aspx >=20 The word construct "attribute specification" is completely right, it specifies which attribute should be applied to the data. The functionality at our disposal to do so---addition and specification of attributes---is through annotating them. Hence, calling the functionality ... - Custom Attributes - Attribute Specifiers - Custom Attribute Specifiers - Extended Attributes =2E.. or something in this vain would get my +1. However, all of them are= rather bulky. On 4/28/2016 8:02 PM, Rowan Collins wrote: > Again, I've not seen anything saying that .net refers to the "public" > keyword as an "attribute", or in any way treats it as equivalent to the= > attribute (or, if you insist, annotation) syntax. In fact, the article = I > quoted earlier explicitly distinguishes the two, referring to "public" > etc as "method-modifiers", and seems clear to me that they are not the > same thing as attributes: > https://msdn.microsoft.com/en-us/library/aa664611%28v=3Dvs.71%29.aspx >=20 Method modifiers are a more specialized form of attributes and it makes sense to refer to them as such because it is less ambiguous than the word attributes. [1] BTW: /public/, /protected/, and /private/ are a special form of modifiers in general and called *access modifiers*: https://en.wikipedia.org/wiki/Access_modifiers On 4/28/2016 8:02 PM, Rowan Collins wrote: >> The name they chose is okay because Perl does not offer any other way = of >> adding attributes to any kind of data in any way (at least none that I= >> am aware off but I am not a Perl programmer). Hence, it is not too >> dangerous to call this functionality attributes as it would be in our >> context where many other attributes are already available. >=20 > Surely under your definition scope modifiers like "local"/"global" and > "my"/"our" would be "attributes"? I think you're really clutching at > straws to distinguish this case from any of the others, just because it= > doesn't agree with your assumptions. >=20 As I said in the initial message, using the term /attribute/ is pretty much never wrong because the term /attribute/ is so generic. :P The only data without any kind of attributes is raw binary data without any meaning. Note that random data does not count, since randomness would be an attribute of the data. > a usually good quality or feature that someone or something has > > --- http://www.merriam-webster.com/dictionary/attribute On 4/28/2016 8:02 PM, Rowan Collins wrote: > By "confirmation bias", I meant that you'd gone out looking for > confirmation that people called them "annotations", rather than > researching what each language calls them. >=20 Actually I checked the dictionaries for the actual definition. This is also how I documented it in the initial message. All additional language links were only used to proof that Java is not the only language that uses the term and that the term is always used in the context. On 4/28/2016 8:02 PM, Rowan Collins wrote: > For instance, you linked to a Rust page, which happened to contain the > word "annotation", but on closer inspection is actually using the terms= > in exactly the opposite way from you: the "lifetime annotation" here is= > a specific syntax to do with lifetimes, and is an "annotation" in the > loose sense of "you are annotating the source code". Meanwhile, in the > menu on the left, we can see a section on "Attributes", which look much= > more like arbitrary metadata of the sort we are discussing right now: > http://rustbyexample.com/attribute.html >=20 That is why there is an empty line between the pages that are actually documenting the usage of an annotation functionality and the pages that are using the term annotation correctly in natural language to describe something. Again, it is about language and terminology. Here is the relevant formatting again, note the dots and empty line: On 4/27/2016 10:11 PM, Fleshgrinder wrote: > 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=3D%E2%9C%93&query=3Dannotation > http://rustbyexample.com/scope/lifetime/explicit.html > https://www.google.de/search?q=3Djavascript+annotation > ... >=20 On 4/28/2016 8:02 PM, Rowan Collins wrote: > I think a survey of what different languages call their metadata > features would be interesting, but so far, I'm not seeing a clear bias > in favour of one or the other. >=20 > Like I say, I personally prefer the term "annotations", but I'm not > going to discount the evidence that major languages like C#/.net, Perl,= > and Rust have chosen the name "attributes" instead. >=20 > Regards, Me neither, I am saying that the term is too generic and that we should use the term annotation in order to make it unique, easily understandable, non-ambiguous in terms of natural language and not in terms of what others use or do. [1] https://en.wikipedia.org/wiki/Attribute_%28computing%29 --=20 Richard "Fleshgrinder" Fussenegger --IvGwnKluOuHuPJ2DIGOgdNnNwpQ6OTacl-- --ATOV23E6lI4qBO7DM02lOq0SciCmtU0Om Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXImKeAAoJEOKkKcqFPVVrPnkQALsX+L2l6BAOwJSt7XFLtLaI 0vHzhX2xbOt3yQES47Rg1Ig04rkAOlckOsSr86eMJ2vZd+Med3EMMXNhR/Kaqbbc NHyej9Nldm21wxrQ3ag7nE+xupQUQ7437lrkk2a9Bhmd6JoW59ld3z/QVLVi4wA1 I0yeqNAS7FMm7sXqJcv4X+mUvLp+yZkN4ubot8eJCcAWQ5UIbDipUghw7ku/Nbhm b9ovNDd3FXj+t9Fpa0VnJjeGm9BcbNTolwlIKBkoSMZACKVqit4bj+lq0SaPhwdD tGF45rC/3edfXwCn9pgQudVkZZyOYNOx6VO2ckDG9ewI24Dl5GSOtfOuoerU+a0d uvONrNlF6HSW5U7eMKnUQEQBNyD/Vs4+YCNR7ivEBcf7aoN7EL2RDU31lOqxcYEE noCV0c3VVJpNqJjIKYmOdZv4WkASaHtkOXtBy21sXMVGbTgDTPpkWquFJVsLwX5H JKxfl/qvr2hEGuU7VAd2zhWvklfZJm1s7atJUsDr0U6V3ahXEct/QHK2TTR+kTyz KQaO9pn6MXHOjCYEsAafu2V77x1rfaQoxPFWbi9W55Za597hhWGnKdZN4tV5Hn1v vcbKZipeiInKFstDMMXggxysqnM3ipyb+gPs5WK0gTvU9G3RunW3Lp6KHn2w7jWP 0qGWKwbyHe5rIh/OZjJO =+FtN -----END PGP SIGNATURE----- --ATOV23E6lI4qBO7DM02lOq0SciCmtU0Om--