Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52212 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48499 invoked from network); 10 May 2011 12:28:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 May 2011 12:28:56 -0000 Authentication-Results: pb1.pair.com header.from=martinscotta@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=martinscotta@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: martinscotta@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:53896] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DD/90-43407-78F29CD4 for ; Tue, 10 May 2011 08:28:56 -0400 Received: by vwl1 with SMTP id 1so493018vwl.29 for ; Tue, 10 May 2011 05:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ul2655TTzXJVXtZCLU6jYK+Uj4Z9VQnRc5PmOBAjglg=; b=GJT619wuF4NFeMD0C6IqB5LMLdNZrWG+I/nH8Id19Yzl5INKJ5DdQ/pKQgYm7dqkCW aKQBblhIOJmMvjFOm5gqoDgsDQnwcPm9gDzFnxwzwIT3x6zNlWGgH9P8tih4uhZsOzuE 6cDAf5CxTdx36vZDfrdwQ5actgGToTMg41vNA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=tf5dveAqltr36Q3WSxGn2uB2sbyuCxgki+LwaWTy9WHN2e7UsVFKgJ2W0ZSueq3PX4 mLbGdJb3pyXRhaWuwcXWz/Xge8wFF9XfA8OKEBDzX6wNDXK6A3h+cflQXQYRDXYaU8Pz qCBzc/TVofysSHMyhULyDThNSSK3Uv4p/Fr40= MIME-Version: 1.0 Received: by 10.52.115.72 with SMTP id jm8mr998923vdb.93.1305030533112; Tue, 10 May 2011 05:28:53 -0700 (PDT) Received: by 10.220.191.1 with HTTP; Tue, 10 May 2011 05:28:53 -0700 (PDT) In-Reply-To: <4DC8FB1A.7040206@lerdorf.com> References: <4DC826B1.4090806@lerdorf.com> <4DC82A36.8090604@lerdorf.com> <4DC83401.2090202@sugarcrm.com> <4DC8D122.3050507@lsces.co.uk> <4DC8F125.2010503@toolpark.com> <4DC8FB1A.7040206@lerdorf.com> Date: Tue, 10 May 2011 09:28:53 -0300 Message-ID: To: Rasmus Lerdorf Cc: Jordi Boggiano , Lars Schultz , internals@lists.php.net Content-Type: multipart/alternative; boundary=bcaec548a44558e37804a2eb19fc Subject: Re: [PHP-DEV] annotations again From: martinscotta@gmail.com (Martin Scotta) --bcaec548a44558e37804a2eb19fc Content-Type: text/plain; charset=ISO-8859-1 On Tue, May 10, 2011 at 5:45 AM, Rasmus Lerdorf 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: > > > > class User { > > > > > 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 > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --bcaec548a44558e37804a2eb19fc--