XHP: A New Way to Write PHP (from Facebook)
facebook.com
XHP: A New Way to Write PHP (from Facebook)
1–10 of 72 posts
Re: XHP: A New Way to Write PHP (from Facebook)
#2IMHO, It is the only PHP tool I use at facebook that is better than alternatives in other languages. I'm looking at you, django templates!
The notation perfectly represents the objects, with no cruft associated with object oriented programming. That is really rare. You could argue that the markup syntax is cruft, but it really helps code readability to have two types of syntax, for code and for markup.
$b = quotes and variables;
$a = omg, I can't "believe" how easy these {$b} are;Re: XHP: A New Way to Write PHP (from Facebook)
#3 That is, it is impossible to generate malformed webpages while using XHP.
While the purist in me thinks this is great if everyone else uses it, the immense amount of productivity lost when I first started using kid templating (e.g. http://turbogears.org/about/kid.html ) really burned me on this whole concept.Sometimes I really do want to make a quick test page without crossing all my i's and dotting all the t's. Importing non-perfect markup from a designer is a big pain, too, in this kind of templating system.
And, though it's unfair to say so, some companies do well enough without 100% valid XML markup: http://blog.errorhelp.com/2009/06/27/the-highest-traffic-sit...
Re: XHP: A New Way to Write PHP (from Facebook)
#4Re: XHP: A New Way to Write PHP (from Facebook)
#5That is, it is impossible to generate malformed webpages while using XHP. While the purist in me thinks this is great if everyone else uses it, the immense amount of productivity lost when I first started using kid templating (e.g. http://turbogears.org/about/kid.html ) really burned me on this whole concept. Sometimes I really do want to make a quick test page without crossing all my i's and dotting all the t's. Imp…
For the rest of us, clarity and semantically correct code are much more useful.
Re: XHP: A New Way to Write PHP (from Facebook)
#6very, very cool. i can't wait to dig into this more... it looks like even the basic examples are cool, but there's lots of stuff under the hood waiting to be discovered.
Re: XHP: A New Way to Write PHP (from Facebook)
#7Re: XHP: A New Way to Write PHP (from Facebook)
#8 echo blah;Re: XHP: A New Way to Write PHP (from Facebook)
#9seems to me that if they went to the trouble to make it understand xml syntax and error out on invalid code, they should have just made it auto-close tags. on pages where there are heavily nested divs and other things, auto-closing the tags would make the code smaller while still generating valid xhtml and not bothering the developer with such trivial things. echo blah;