For me, XHP is far more interesting than HipHop. And I say that as someone who administers a pile of single-application CPU-bound PHP servers. This completely and forever changes the templates-vs-just-PHP debate, and I'm glad -- it's the kind of evolution PHP needs to continue to be taken seriously.
XHP: A New Way to Write PHP (from Facebook)
41–50 of 72 posts
Re: XHP: A New Way to Write PHP (from Facebook)
#42For me, XHP is far more interesting than HipHop. And I say that as someone who administers a pile of single-application CPU-bound PHP servers. This completely and forever changes the templates-vs-just-PHP debate, and I'm glad -- it's the kind of evolution PHP needs to continue to be taken seriously.
Strangely enough, I'm reading your PHP code just now :)
Re: XHP: A New Way to Write PHP (from Facebook)
#43Earlier quoted context omitted.
Strangely enough, I'm reading your PHP code just now :)
Heh, which code is that? If it's anything to do with a certain salesforce-like system at a certain log-searching company, I apologize. :)
Re: XHP: A New Way to Write PHP (from Facebook)
#44Earlier quoted context omitted.
Couple questions: 1. How is this different from Django filters? Is it that the default is HTML escaping instead of having to specify the escaping with each template variable? 2. How does it handle different escaping contexts? For example, text in html attributes needs to be escaped differently from text in the body of the document. Text in URLs or JavaScript has to be escaped differently still, and often times you ha…
I'm also very interested in how it is able to escape properly... anybody?
Re: XHP: A New Way to Write PHP (from Facebook)
#45Earlier quoted context omitted.
Not really. You can still separate MVC style. Templates have always had some display logic, which is ok. What you don't want is intermixed application logic.
In my opinion this "fuzzy" separation is exactly what frameworks like Django (and many existing PHP MVC frameworks) tries to avoid - they specifically disallow things like arithmetic in their templating language for this reason. As soon as you get more than one person working on a site, you're going to have an overly ambiguous demarcation point between the presentation and the logic layers and it's going to wreak hav…
Re: XHP: A New Way to Write PHP (from Facebook)
#46BTW for those of you interested in installing on Linux, you'll need php5-dev (so on deb/ubuntu machines a quick apt-get install php5-dev solves it). Run phpize from the root, then the normal ./configure, make, make install etc...
has anyone gotten this to work on OSX? I get strange errors after I build and add the extension to php.ini LOG: http://pastie.org/817528
Re: XHP: A New Way to Write PHP (from Facebook)
#47Earlier quoted context omitted.
What is the fundamental problem it masks?
The separation of presentation and logic. Anyone who's spent the 1990s coding Perl CGI will tell you just how big of a step backward this is.
Let's take a real case: Smarty. To my eye, XHP is going to take a huge slice of the PHP template system market away from Smarty. The reason is that XHP gives you the native constructs of PHP (sans mind-bending hacks -- try referencing a class constant in Smarty) while staying at the right level of abstraction for fast development: chunks of valid XHTML.
Re: XHP: A New Way to Write PHP (from Facebook)
#48Earlier quoted context omitted.
Heh, which code is that? If it's anything to do with a certain salesforce-like system at a certain log-searching company, I apologize. :)
No, thank god that (salesforce-like system) is dead :) Something called 'spacecake'...
Re: XHP: A New Way to Write PHP (from Facebook)
#49http://sla.ckers.org/forum/read.php?2,20408
Any code mix operation & data is dangerous. That's all how overflow exp, injection and XSS works
Re: XHP: A New Way to Write PHP (from Facebook)
#50Earlier quoted context omitted.
Not really. You can still separate MVC style. Templates have always had some display logic, which is ok. What you don't want is intermixed application logic.
In my opinion this "fuzzy" separation is exactly what frameworks like Django (and many existing PHP MVC frameworks) tries to avoid - they specifically disallow things like arithmetic in their templating language for this reason. As soon as you get more than one person working on a site, you're going to have an overly ambiguous demarcation point between the presentation and the logic layers and it's going to wreak hav…