Hacker News new | ask | show | jobs
by daraosn 4619 days ago
Why having this if you have Ruby, Python or even Node.js... and why having PHP at all! all I can think of is dinosaurs and extinction. Move on guys, PHP was cool several years ago, and I enjoyed it a lot, but now it should be buried already and you're trying to create a zombie here.
1 comments

Ignoring Node for a moment, Ruby and Python currently have a noticeably higher barrier to entry for the kind of personal home page that PHP was named for. <html-stuff><html-otherstuff> <?php $todays-date ?php> <making-up-the-syntax-as-I-go-because-Ive-forgotten-it-all>

AFIAK, in either Ruby or Python the equivalent of that would be far harder. You'd need a program made of several separate files, have to grab Rails from somewhere, have some concept of responding to requests somewhere and a bunch of stuff other than the one time stamp above. Though I suppose you could use client-side JS here too.

What are you talking about? This is the problem of why PHP is still being used, because developers think that Ruby or Python don't allow you to do several stuff you actually can... look at this example (ERB lets you run Ruby code the same way):

  $ cat test.erb
  Hello there! Today = <%=Time.now%>
  $ erb test.erb
  Hello there! Today = Sat Oct 26 16:42:36 +0200 2013
Plus you still need to run PHP over a server (Apache, Nginx, or what so ever), so I don't see so much difference with Rails, Django or Express, except that PHP is an old and stinky language.
Really, the only reason Python and Ruby have the same "noticeably higher" barrier to entry is because most cheap hosting services don't support Python and Ruby the same way they do PHP. Python and Ruby are just as easy, if not easier, for a beginner to get into outside of web dev.
Have you heard of python -m HTTPServer

There is your HTTP Server.

What a little more dynamic? Sure. Download Bottle. A single file! Then write something in a separate Python module and you can write raw html too in the bottle response. No jinja is needed.

Piece of cake. Lighter than what PHP would require you to setup.