On Wed, 15 Sep 2010 23:00:15 +0100, Stas Malyshev <smalys...@sugarcrm.com>
wrote:
easy as possible for the sooner. In the case of the annotation, the
kids writing their websites won't use them, the learning curve remains
unchanged.
No, because they look at the framework code and when they see all this
{...@#!blah($...@blah=blah$^)]} they'd have hard time figuring out what that
means - unless we make it easy. I understood that common consensus was
even [1,2,3] is not easy enough - has that changed?
They won't look at framework code; they'll look at some random tutorial
about PHP+MySQL and write a program full of vulnerabilities :p
Do you really think they'll go see the source code for Symphony?... They
won't understand it as it is now.
Anyway, this is not even remotely comparable to [1,2,3]. One is mere
syntactic sugar (albeit easier on the keyboard and arguably more readable)
that solves the same problem as a construct we already have, the other is
actually new functionality, which happens to require new syntax.
I agree that a language should be beginner-friendly; after all, beginners
will always be the majority of the users for any live language.
But can't we have a language that's easy to learn (you can start writing
programs in it very quickly), yet powerful, i.e., expressive? Annotations
are very expressive (please don't say "there are no use cases"); they have
a wide range of applications, from simplifying configuration to making
aspect oriented programming much cleaner.
From my experience when I first learned about annotations, the concept is
very easy to apprehend. What's difficult is to understand what they can be
useful for.
They can also be a bit dangerous because they may hide the code that's
actually being run. Whether that will be a problem or not, only the future
will tell. Still, I don't think it will be nearly as dangerous as global
variables or variable variables (or as other stuff we don't have, like
operator overloading).
--
Gustavo Lopes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php