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