Re: [SMARTY-DEV] object registration committed

From: Date: Fri, 24 Jan 2003 11:55:11 +0000
Subject: Re: [SMARTY-DEV] object registration committed
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-613@lists.php.net to get a copy of this message
The first is shorter and an existing syntax, the second is more consistant with the longer object syntax and is distinct, possibly avoiding future syntax collisions. So which is better, existing syntax or distinct, more consistant syntax?
Since a template consumer already needs to know which variables "have" methods and which don't, I think the explicitness of "->" will work better in the long run for method calls. How about allowing "." or "->" for property access, but requiring "->" for methods?
I'd certainly vote for explicitness. Objects are and should be treated differently. That will make it easier to spot and avoid errors because you thought or forgot that one was the other. It also makes Smarty more approachable for existing PHP programmers that'll get a template language which behaves more like they would expect. -- David Heinemeier Hansson http://www.loudthinking.com/ -- Broadcasting Brain

« previous php.smarty.dev (#613) next »