atom feed193 messages in net.php.lists.internalsRe: [PHP-DEV] annotations again
FromSent OnAttachments
22 earlier messages
Andi GutmansMay 9, 2011 10:22 am 
guil...@gmail.comMay 9, 2011 10:25 am 
Christopher JonesMay 9, 2011 10:27 am 
Stas MalyshevMay 9, 2011 10:30 am 
guil...@gmail.comMay 9, 2011 10:31 am 
Andi GutmansMay 9, 2011 10:32 am 
Rasmus LerdorfMay 9, 2011 10:38 am 
Ferenc KovacsMay 9, 2011 10:43 am 
guil...@gmail.comMay 9, 2011 10:44 am 
guil...@gmail.comMay 9, 2011 10:47 am 
guil...@gmail.comMay 9, 2011 10:50 am 
Rasmus LerdorfMay 9, 2011 10:53 am 
guil...@gmail.comMay 9, 2011 11:07 am 
Stas MalyshevMay 9, 2011 11:13 am 
Stas MalyshevMay 9, 2011 11:35 am 
Ferenc KovacsMay 9, 2011 11:39 am 
guil...@gmail.comMay 9, 2011 11:52 am 
Stefan MarrMay 9, 2011 12:33 pm 
Lester CaineMay 9, 2011 2:41 pm 
dukeofgamingMay 9, 2011 3:00 pm 
Ilia AlshanetskyMay 9, 2011 3:09 pm 
Andi GutmansMay 9, 2011 3:39 pm 
guil...@gmail.comMay 9, 2011 4:26 pm 
guil...@gmail.comMay 9, 2011 4:29 pm 
Lester CaineMay 9, 2011 5:25 pm 
Stas MalyshevMay 9, 2011 5:35 pm 
guil...@gmail.comMay 9, 2011 5:35 pm 
Ferenc KovacsMay 9, 2011 5:35 pm 
guil...@gmail.comMay 9, 2011 5:55 pm 
Stas MalyshevMay 9, 2011 6:22 pm 
Pierrick CharronMay 9, 2011 8:03 pm 
Mike WillbanksMay 9, 2011 8:42 pm 
Pierrick CharronMay 9, 2011 8:50 pm 
DrakMay 9, 2011 9:09 pm 
Lester CaineMay 9, 2011 10:45 pm 
Pascal COURTOISMay 9, 2011 11:06 pm 
Chad FultonMay 10, 2011 12:01 am 
Ferenc KovacsMay 10, 2011 12:43 am 
Lars SchultzMay 10, 2011 1:02 am 
Jordi BoggianoMay 10, 2011 1:10 am 
Lars SchultzMay 10, 2011 1:16 am 
Rasmus LerdorfMay 10, 2011 1:44 am 
Sebastian BergmannMay 10, 2011 2:34 am 
Ferenc KovacsMay 10, 2011 2:39 am 
Sebastian BergmannMay 10, 2011 2:40 am 
Ferenc KovacsMay 10, 2011 3:04 am 
DrakMay 10, 2011 3:21 am 
Stefan MarrMay 10, 2011 4:04 am 
Arvids GodjuksMay 10, 2011 4:42 am 
Martin ScottaMay 10, 2011 5:28 am 
Martin ScottaMay 10, 2011 5:46 am 
Ferenc KovacsMay 10, 2011 6:13 am 
Lars SchultzMay 10, 2011 6:37 am 
chri...@mohiva.comMay 10, 2011 6:55 am 
Lars SchultzMay 10, 2011 7:12 am 
PasMay 10, 2011 7:19 am 
Alain WilliamsMay 10, 2011 7:19 am 
Christian KapsMay 10, 2011 7:50 am 
Lester CaineMay 10, 2011 8:02 am 
Arvids GodjuksMay 10, 2011 8:07 am 
guil...@gmail.comMay 10, 2011 8:07 am 
Lester CaineMay 10, 2011 8:20 am 
Jonathan Bond-CaronMay 10, 2011 8:43 am 
Lester CaineMay 10, 2011 8:49 am 
Jonathan Bond-CaronMay 10, 2011 8:51 am 
Matthew Weier O'PhinneyMay 10, 2011 8:56 am 
Matthew Weier O'PhinneyMay 10, 2011 8:57 am 
Lester CaineMay 10, 2011 9:10 am 
Stas MalyshevMay 10, 2011 9:30 am 
guil...@gmail.comMay 10, 2011 9:46 am 
Zeev SuraskiMay 10, 2011 9:47 am 
Sebastian BergmannMay 10, 2011 10:14 am 
Sebastian BergmannMay 10, 2011 10:15 am 
Matthew Weier O'PhinneyMay 10, 2011 10:19 am 
DrakMay 10, 2011 10:29 am 
Lester CaineMay 10, 2011 11:12 am 
Christopher JonesMay 10, 2011 11:16 am 
Mike RobinsonMay 10, 2011 11:20 am 
Ferenc KovacsMay 10, 2011 11:21 am 
Lester CaineMay 10, 2011 11:22 am 
Ferenc KovacsMay 10, 2011 11:27 am 
Ferenc KovacsMay 10, 2011 11:28 am 
Matthew Weier O'PhinneyMay 10, 2011 12:27 pm 
dukeofgamingMay 10, 2011 12:28 pm 
guil...@gmail.comMay 10, 2011 12:31 pm 
guil...@gmail.comMay 10, 2011 12:35 pm 
DrakMay 10, 2011 12:36 pm 
Ferenc KovacsMay 10, 2011 12:40 pm 
Ferenc KovacsMay 10, 2011 12:41 pm 
dukeofgamingMay 10, 2011 12:44 pm 
Rasmus LerdorfMay 10, 2011 12:44 pm 
DrakMay 10, 2011 12:49 pm 
Rasmus LerdorfMay 10, 2011 12:51 pm 
Chad FultonMay 10, 2011 1:02 pm 
Christopher JonesMay 10, 2011 1:28 pm 
Lester CaineMay 10, 2011 2:32 pm 
Lars SchultzMay 10, 2011 3:03 pm 
guil...@gmail.comMay 10, 2011 3:27 pm 
Johannes SchlüterMay 10, 2011 5:01 pm 
Johannes SchlüterMay 10, 2011 5:15 pm 
71 later messages
Subject:Re: [PHP-DEV] annotations again
From:Martin Scotta (mart@gmail.com)
Date:May 10, 2011 5:28:30 am
List:net.php.lists.internals

On Tue, May 10, 2011 at 5:45 AM, Rasmus Lerdorf <ras@lerdorf.com> wrote:

On 05/10/2011 01:10 AM, Jordi Boggiano wrote:

On Tue, May 10, 2011 at 10:02 AM, Lars Schultz

To explain what I mean, I'll use the example provided in the RFC. Could

anyone please explain the advantages of having "passive" annotations over "active" PHP Code.

I think your example shows very well why annotations are good, it's much more concise.

By concise, you mean shorter, easier to read?

I have a really hard time looking at:

<Entity("users")> class User { <Column("integer")> <Id> <GeneratedValue("AUTO")> <ManyToMany("Phonenumber")> protected $Phonenumbers; }

as a PHP user and instantly understanding what this does. It looks completely foreign from a PHP syntax point of view.

Whereas:

class User_EntityAnnotation { public function getEntityName() { return 'users'; }

public function getColumnInfo($property) { switch($property) { case 'id': return array( 'column'=>'integer', 'isPrimary'=>true, 'autoIncrement'=>true );

case 'Phonenumbers': return array( 'manytomany'=>'Phonenumber' ); } } }

is way more verbose, but I can instantly grok what is going on without learning a new syntax, without waiting for my opcode cache to support it, and without waiting for my editor to understand the new syntax.

The editor argument is out of place do you really think that the engine should we built around what IDE supports?

Don't underestimate the difficulty in getting opcode cache support for something like this. If you think the engine code is complex, try digging into the opcode cache code. It will be much much harder to write the opcode cache support than it was to write the engine code for it.

I also have a personal problem with code that needs to introspect on every web request in order to run. But that is likely because I am old and gray and used to stare sceptically at the assembly output of the first C compilers to see if I could come up with an alternative that would take fewer cycles.

-Rasmus