Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As easy as PHP in what sense? That Python is basically part of all OS' now or as easy as putting in <?php echo "Hello World"; ?> in a .php file and uploading it to your server?

I severely doubt it's as easy as the latter. I'd like to see an article that explains in less than 140 chars how to deploy a simple app as Hello World to the web in Python without the use of a framework like Django or Flask.

Edit: In the amount of chars Twitter accepts, here's how to get Hello World going in PHP.

sudo apt-get install php5 && echo '<?php echo "hello world"; ?>' > /var/www/index.php

85 characters. I'm done. Now let's see this done in Python... Ruby... Any other popular language this quickly.



  echo "hello world" > index.html && python -m SimpleHTTPServer
:)


This just made me laugh. It reminded me of http://projecteuler.net/ where you are feeling proud because your solution works and then you realize it can be done in one line of one line of Haskel/Python/Perl/Ruby =).


Your example of simplicity is a bit conflated since you don't even need PHP to put hello world on a internet visible web page in the first place:

echo 'hello world' > /var/www/index.html

Set up something a little more useful albeit trite such as a blog and you wouldn't be able to do that in 10 minutes with PHP without using a framework either. PHP is great for "unit testing" of ideas but once it grows out of that it's debateable

I do concur that deploying a Python or Ruby web app is a pain in the ass. Installing git and installing Heroku, you're only 2 lines of code away though.


> Installing git and installing Heroku, you're only 2 lines of code away though.

Which requires you to learn git.


OK, so here we have someone who knows PHP but not Git. Knowing PHP, probably they're a web developer and have also learned the standard stack there: HTML, CSS, Javascript, MySQL, and Subversion. And with the way the HTML5 family of technologies is exploding nowadays, that's no small feat.

You're saying that learning Git is going to be the barrier to someone switching to Ruby? Naw, don't think so.


We're making different assumptions. You're assuming a well-rounded web developer that just wants to deploy, while I'm thinking more from the beginner developer perspective. We're both right with our assumptions applied.


   gem install sinatra && echo "require 'sinatra';get '/' do 'Hello, world!';end" > hi.rb && ruby hi.rb
100 characters.


sudo apt-get install ruby-full build-essential rubygems apache2 && sudo gem install rails && rails hello && cd hello && rails generate controller hello && rails script/server && wget http://127.0.0.1:3000 -o -

Wait, that didn't work. I got all kinds of errors and warnings. I must have the wrong version of something. You win, point taken.

There should be an easier way. I should be able to just run "apt-get install rails-easy" and have a system that is completely configured for development.


Who cares? Honestly? I'm shocked and appalled that the measure of ease of a web development language is the trivialness of a Hello World. This willy-nilly nature of PHP leads to the disaster that it is today. The language and API are, at every turn, willy nilly. The projects that use them are constantly rewriting and refactoring to follow a new or better pattern or organization.

I haven't touched python in too many months to write it here, but it's not much harder than importing an http package, creating a two line handler and listening for connections. Now you have a much more realistic and robust system and your potential for applications is already hugely increased. (Write a websocket server in php, go on).

Here, I can write "Hello World" in an even easier language!

`cat "Hello World" > index.html`


| Who cares? Honestly?

Exactly, who cares?


My point is that "ease" of "Hello World" does not translate to "ease" of developing [anything 'real'].


My point is this whole thread, the article linked, my reply, your reply. Who cares?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: