Hello,

I would like to correct you both on what appears to be a
misunderstanding.

On May 26, 12:39 pm, Jordi Boggiano <[email protected]> wrote:
> On 26.05.2011 17:58, Oleg Stepura wrote:
> > Do we really need to mimic the PHP syntax in annotations? ...
>
> I would say that yes, we need to mimic PHP syntax. ...

The point is not to mimic PHP - but simply to let PHP take over.
Anything between parentheses can be parsed by PHP, which means the
amount of parsing that has to actually be implemented by the
annotation engine is absolutely minimal.

Personally, my first argument for the PHP-style syntax would not
merely be the fact that it looks and feels like PHP, but the fact that
annotations are code... stloyd mentioned the PHP-RFC, which (like the
previous one) makes the mistake of proposing a simple data-
serialization format (a custom one in the old RFC, and again as JSON
in the new one) as the means to configure annotations.

This is bad, because data formats can't support code - PHP array
syntax supports all manner of handy features, for example the
following annotations would be possible (and don't ask me what these
do, just dumb examples...)

  @calculate(function($a,$b) { return $a*$b; })

  @length('max' => MyApp::STANDARD_MAX_LENGTH)

  @date('format' => current_locale_date_format())

  @value(10+20*50/2.5)

Using a data serialization format for initialization prevents you from
making any kind of dynamic calculations like this - in my opinion,
source-code annotations should enable you to take advantage of the
programming language itself...

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to