News for hackers. Stuff that matters.
Re:How I Build PHP Applications by mixmax on Friday April 23, 2010 @01:37PM (#1288827)
And here it is in PHP:

echo "Hello world";

One line. Just saying....

Re:How I Build PHP Applications by cmelbye on Friday April 23, 2010 @01:57PM (#1288905)
Except not at all. Your example doesn't handle a clean URL like "/hi" (it would be something like "/hi.php" at best in PHP). Furthermore, it doesn't force the GET http request type, which is a major part of the Sinatra microframework. I can setup a Ruby script that outputs "Hello World", but that would miss the point entirely.

EDIT: Also, the original ruby example could be condensed to one line as well:

  get "/hi" { "Hello world" }
Run with ruby -rsinatra script.rb