<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" 
      xmlns:thr="http://purl.org/syndication/thread/1.0">
  <link rel="alternate" type="text/html" href="http://www.readwriteweb.com/archives/xhp_more_php_enhancement_from_facebook.php" />
  <link rel="self" type="application/atom+xml" href="http://www.readwriteweb.com/atom.xml" />
  <id>tag:www.readwriteweb.com,2011:/1/tag:www.readwriteweb.com,2010://1.18194-</id>
  <updated>2011-08-16T15:51:11Z</updated>
  <title>Comments for Facebook Debuts XHP: More PHP Enhancement </title>
  
  <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.35-en</generator>
  <entry>
    <id>tag:www.readwriteweb.com,2010://1.18194</id>
    <link rel="alternate" type="text/html" href="http://www.readwriteweb.com/archives/xhp_more_php_enhancement_from_facebook.php" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.readwriteweb.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=18194" title="Facebook Debuts XHP: More PHP Enhancement " />
    <published>2010-02-10T07:13:43Z</published>
    <updated>2010-02-10T07:18:17Z</updated>
    <title>Facebook Debuts XHP: More PHP Enhancement </title>
    <summary>Last week, we were chasing our tails in giddiness over HipHop, a newly open-sourced PHP runtime developed in house at Facebook. Today, amid the rabid excitement over Google Buzz, Facebook quietly pumped some more code into the world. XHP is a new way to write PHP that &quot;augments the syntax of the language to both...</summary>
    <author>
      <name>Jolie O&apos;Dell</name>
      
    </author>
    
    <category term="Facebook" />
    
    <content type="html" xml:lang="en" xml:base="http://www.readwriteweb.com/">
      <![CDATA[<p><img src="http://www.readwriteweb.com/jolie-facebook-logo.png">Last week, we were <a href="http://www.readwriteweb.com/tag/hiphop">chasing our tails in giddiness</a> over HipHop, a newly open-sourced PHP runtime developed in house at Facebook.</p>

<p>Today, amid the <a href="http://www.readwriteweb.com/tag/buzz">rabid excitement</a> over Google Buzz, Facebook quietly pumped some more code into the world. <a href="http://www.facebook.com/notes/facebook-engineering/xhp-a-new-way-to-write-php/294003943919">XHP</a> is a new way to write PHP that "augments the syntax of the language to both make your front-end code easier to understand and help you avoid cross-site scripting attacks," according to Facebook engineer Marcel Laverdet. <font style="float: right; margin-left: 10px;"><script type="text/javascript">tweetmeme_url = 'http://www.readwriteweb.com/archives/xhp_more_php_enhancement_from_facebook.php';tweetmeme_source = 'rww';</script><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></font>"XHP has enabled us to build better websites faster; our Lite site was written entirely with XHP."</p>

<p>Here's what a few developers, including PHP creator Rasmus Lerdorf, had to say about it.</p>]]>
      <![CDATA[<p>Lerdorf <a href="http://toys.lerdorf.com/archives/54-A-quick-look-at-XHP.html">describes XHP</a> as "a new PHP extension today that supports inlining XML... It adds an extra parsing step which maps inlined XML element to PHP classes.</p>

<p>"The main interest, at least to me, is that because PHP now understands XML it is outputting, filtering can be done in a context-sensitive manner."</p>

<p>He also comments on XHP's significant performance issues and speculates how XHP would work specifically at Facebook.</p>

<p>"Running XHP on plain PHP is definitely out of the question. But, knowing that Facebook uses APC [alternative PHP cache] heavily and looking through the code (see the MINIT function in ext.cpp) we can see that it should play nicely with APC... So, when you combine XHP with HipHop PHP you can start to imagine that the performance penalty would be a lot less than 75% and it becomes a viable approach."</p>

<p>Meanwhile, over at <a href="http://news.ycombinator.com/item?id=1113832">Hacker News</a>, <a href="http://www.wikispaces.com">Wikispaces</a> creator <a href="http://jbyers.com/html/">James Byers</a> <a href="http://news.ycombinator.com/item?id=1114015">writes</a>, "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."</p>

<p><a href="http://tipjoy.com/">Tipjoy</a> co-founder and current Facebook engineer <a href="http://kirigin.com">Ivan Kirigin</a> also chimes in with strong praise, <a href="http://news.ycombinator.com/item?id=1113854">saying</a>, "XHP rocks so [expletive deleted] hard, it isn't even funny. It is just so much better than alternatives.</p>

<p>"IMHO, 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."</p>

<p>Here's <a href="http://github.com/facebook/xhp/">XHP on GitHub</a>, and here's the <a href="http://github.com/facebook/xhp">documentation wiki</a>. Take a look, and let us know what you think in the comments!</p>]]>
    </content>
  </entry>

  <entry>
    <id>tag:www.readwriteweb.com,2010://1.18194-comment:246111</id>
    <thr:in-reply-to ref="tag:www.readwriteweb.com,2010://1.18194" type="text/html" href="http://www.readwriteweb.com/archives/xhp_more_php_enhancement_from_facebook.php"/>
    <link rel="alternate" type="text/html" href="http://www.readwriteweb.com/archives/xhp_more_php_enhancement_from_facebook.php#c246111" />
    <title>Comment from Satya Prakash on 2010-09-20</title>
    <author>
        <name>Satya Prakash</name>
        <uri>http://www.satya-weblog.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.satya-weblog.com">
        <![CDATA[<p>with lots of negative comments here,I can only say that I hated to use smarty. but about XHP, i can only say anything after using it for at least few days. I personally feel that PHP does not need any template system. but to force programmer (bad! )does not mix PHP and HTML too much, templating system is needed. </p>]]>
    </content>
    <published>2010-09-20T11:22:53Z</published>
  </entry>

  <entry>
    <id>tag:www.readwriteweb.com,2010://1.18194-comment:189606</id>
    <thr:in-reply-to ref="tag:www.readwriteweb.com,2010://1.18194" type="text/html" href="http://www.readwriteweb.com/archives/xhp_more_php_enhancement_from_facebook.php"/>
    <link rel="alternate" type="text/html" href="http://www.readwriteweb.com/archives/xhp_more_php_enhancement_from_facebook.php#c189606" />
    <title>Comment from x y on 2010-02-13</title>
    <author>
        <name>x y</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>XHP PHP blah blah blah... Facebook's "customers" don't care.  unfortunately for the past year or so the Facebook programmers have been making VERY unpopular changes to their user interface.  XHP apparently has been allowing the Facebook programmers to create these unpopular changes more quickly.  Perhaps too quickly.<br />
</p>]]>
    </content>
    <published>2010-02-13T13:22:51Z</published>
  </entry>

  <entry>
    <id>tag:www.readwriteweb.com,2010://1.18194-comment:187490</id>
    <thr:in-reply-to ref="tag:www.readwriteweb.com,2010://1.18194" type="text/html" href="http://www.readwriteweb.com/archives/xhp_more_php_enhancement_from_facebook.php"/>
    <link rel="alternate" type="text/html" href="http://www.readwriteweb.com/archives/xhp_more_php_enhancement_from_facebook.php#c187490" />
    <title>Comment from Dev on 2010-02-10</title>
    <author>
        <name>Dev</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>They should've switched to pure .NET ages ago. ASP.NET 4.0 is light years ahead of this XHP/PHP jumbled mess.</p>]]>
    </content>
    <published>2010-02-10T16:52:41Z</published>
  </entry>

  <entry>
    <id>tag:www.readwriteweb.com,2010://1.18194-comment:187386</id>
    <thr:in-reply-to ref="tag:www.readwriteweb.com,2010://1.18194" type="text/html" href="http://www.readwriteweb.com/archives/xhp_more_php_enhancement_from_facebook.php"/>
    <link rel="alternate" type="text/html" href="http://www.readwriteweb.com/archives/xhp_more_php_enhancement_from_facebook.php#c187386" />
    <title>Comment from commenter on 2010-02-10</title>
    <author>
        <name>commenter</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Oh okay. Having looked at the wiki (link above is wrong) this is adding support for XML literals. It's also a feature of VB.NET.</p>]]>
    </content>
    <published>2010-02-10T09:30:25Z</published>
  </entry>

  <entry>
    <id>tag:www.readwriteweb.com,2010://1.18194-comment:187368</id>
    <thr:in-reply-to ref="tag:www.readwriteweb.com,2010://1.18194" type="text/html" href="http://www.readwriteweb.com/archives/xhp_more_php_enhancement_from_facebook.php"/>
    <link rel="alternate" type="text/html" href="http://www.readwriteweb.com/archives/xhp_more_php_enhancement_from_facebook.php#c187368" />
    <title>Comment from Warren Benedetto on 2010-02-09</title>
    <author>
        <name>Warren Benedetto</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>I must be missing something. The devs quoted in this article are so effusive about this, but to me it seems kinda ... ugly. </p>

<p>What about separation of concerns? This seems like a fine solution if you've got html and php commingled in your code, but that's really bad practice. It seems like this would actually encourage more of that type of programming. Granted, the commingled html and php would be safer and easier to digest, but from my point of view, it shouldn't be done at all.</p>

<p>The ability to define custom classes and associate them with custom XHP tags is cool, but it can be accomplished in other ways. Indeed, I have a hand-rolled framework which I use for all my projects, and it has this exact functionality built in. The difference is that my module tags live in the html, and all the logic for them lives in the php. There's a clean, bright line between the presentation layer and the application layer. XHR seems to be just the opposite of this.</p>]]>
    </content>
    <published>2010-02-10T07:50:41Z</published>
  </entry>

  <entry>
    <id>tag:www.readwriteweb.com,2010://1.18194-comment:187363</id>
    <thr:in-reply-to ref="tag:www.readwriteweb.com,2010://1.18194" type="text/html" href="http://www.readwriteweb.com/archives/xhp_more_php_enhancement_from_facebook.php"/>
    <link rel="alternate" type="text/html" href="http://www.readwriteweb.com/archives/xhp_more_php_enhancement_from_facebook.php#c187363" />
    <title>Comment from Robin Millette on 2010-02-09</title>
    <author>
        <name>Robin Millette</name>
        <uri>http://rym.waglo.com/</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://rym.waglo.com/">
        <![CDATA[<p>Documentation wiki link should be <a href="http://wiki.github.com/facebook/xhp/" rel="nofollow">http://wiki.github.com/facebook/xhp/</a><br />
</p>]]>
    </content>
    <published>2010-02-10T07:44:57Z</published>
  </entry>

</feed>
