Live data from Hacker News

PHP needs to die. What will replace it?

seldo.com

131–140 of 160 posts

Re: PHP needs to die. What will replace it?

#131

One word: deployment To me, the best thing about PHP is that it is so easy to deploy to pretty much any shared hosting on the planet, not to mention really easy to set up on your local machine (with WAMP/MAMP). I love Rails, but on many occasions have built projects in PHP (using a decent framework like Kohana) just because I was putting this on my client's shared hosting account and didn't want to deal with having t…

One of the interesting things about doing Passenger deployments for Rails is that it's very similar to doing PHP deploys, with the added benefit of the server not reloading any application code until you tell it to. For example: you can update the Rails code on the server, maybe run some data migrations or last-minute production tasks against the new codebase, and THEN tell Passenger to reload the application code. O…

> One of the interesting things about doing Passenger deployments for Rails is that it's very similar to doing PHP deploys, with the added benefit of the server not reloading any application code until you tell it to.

You can get this with PHP's APC opcode caching with file_stat turned off. You deploy and when you're ready you clear the opcode cache.

Or if you want to deploy and clear, then add that to your deploy script. Done.

Re: PHP needs to die. What will replace it?

#132
post #72

To replace PHP you need: 1. To be on all shared hosting everywhere. I.e. you need to be really easy to install, and preferably not involve long-running processes that shared hosts might choke on. 2. To be beginner friendly. No requirement of understanding MVC, or running commands in a shell (hi RoR!). Pure instant gratification. Someone's first step into using PHP is likely going to be "I want the current date in the…

I don't agree that MVC and beginner friendliness are fundamentally incompatible. Nevertheless, if you can't get a "hello world" site set up in a very small number of essentially trivial (and easily memorize-able) steps then that's a big show stopper.

It really depends on the beginner I guess. It seems like what kemayo is saying is that there are beginner programmers and then there are people who don't want to be a programmer at all really, but might like the idea of having a dynamic year string printed in the footer of their page.

Those of us who have been working with computers for a long time - particularly those of us who write code - too easily forget what it's like to be that true beginner and often have a very different idea of what 'trivial' means compared to the beginner. What might barely be a speed bump for us can often be an insurmountable obstacle for them and I really wish I was better at remembering this more often.

Re: PHP needs to die. What will replace it?

#133
post #84
post #80

Earlier quoted context omitted.

Are you saying that developing an API in PHP is insane?

No, I'm saying that the stuff built into PHP is weird and inconsistent. I should change it to "sane default library" from "sane API". My current favorite example of this (ignoring the naming scheme for string functions entirely) is that in_array and strpos are functions that perform (almost) the same task, on two different types. They take their arguments in the opposite order. strpos($haystack, $needle) vs in_array(…

If the inconsistencies really bother you, write:

function my_in_array($haystack, $needle) { return in_array($needle, $haystack); }

or whatever, and be done with it...

Re: PHP needs to die. What will replace it?

#134

Earlier quoted context omitted.

I don't agree that MVC and beginner friendliness are fundamentally incompatible. Nevertheless, if you can't get a "hello world" site set up in a very small number of essentially trivial (and easily memorize-able) steps then that's a big show stopper.

It really depends on the beginner I guess. It seems like what kemayo is saying is that there are beginner programmers and then there are people who don't want to be a programmer at all really, but might like the idea of having a dynamic year string printed in the footer of their page. Those of us who have been working with computers for a long time - particularly those of us who write code - too easily forget what it…

From the perspective of the "average" professional programmer with a CS degree the vast majority of all programmers, even those who get paid to do it, are rank and utter beginners. Most programmers cannot solve fizzbuzz. Most programmers don't grok recursion, and have trouble with iteration from time to time. If you were to look at a graph of # of programmers within different skill level bins the "beginner" bin would outweigh all the others by a significant margin.

That's why you can replace PHP with RoR, you need to replace PHP with something that out PHP's PHP, but is based on sounder principles so that in the important cases where a beginner is climbing up the skill ladder or a system originally created in a "beginner language" grows or becomes sufficiently advanced they won't hit a brick wall where they need to migrate to an entirely different technology in order to progress.

Re: PHP needs to die. What will replace it?

#135
post #103

Earlier quoted context omitted.

> It's so loose and care-free that it doesn't care what you do or how you do it. This is precisely why I fell in love with PHP. My first was BASIC, my second was C, my third was Java, but my fourth ... oh god ... like that slutty girl who will let you do absolutely anything. How can you not fall in love with that?

All I can really say is that I'm getting fed up of it. In keeping with your analogy, I'd certainly prefer one that gave me the odd slap and told me to get my shit together if I tried pushing my luck. (programming languages and sado-masochistic tendencies would be an interesting avenue to explore...)

Perhaps a little appropriate: http://c2.com/cgi/wiki?BondageAndDisciplineLanguage

Re: PHP needs to die. What will replace it?

#136

This past weekend, for the fun of it, I setup MongoDB and Node.js on Windows. After ~3 hours of downloading, reading MongoDB and Node.js example docs, and looking up some config issues on StackOverflow, I had written a small TODO list app. Last night, in about 45 minutes, I setup CoffeeScript and translated my node.js webserver into CoffeeScript, resulting in about 25% fewer lines of code. This is by far one of the e…

I'd like to see a windows installer with node.js, coffeescript, mondodb and a couple apps with some collected docs behind a web server for example. that approach bootstrapped a lot of Rails coders.

a demo video also helps create a lot of interest.

Re: PHP needs to die. What will replace it?

#137
post #47

Earlier quoted context omitted.

PHP is not that bad? What other popular language is worse?

Lua and JS both come to mind. Neither of them are worse than PHP, but they're right around that same level of (un)usability and number of pitfalls.

JS has bad parts, but it has good parts as well. And those parts are pretty great.

PHP is all bad parts. Easily the most inconsistent, poorly designed language in popular use today.

Re: PHP needs to die. What will replace it?

#138
Django is capable but not really what developers expect from MVC, and other MVC frameworks for Python have much less traction.

Wow, that's a pretty strong statement. I would like to see some sources for it or at least further explanations.

Re: PHP needs to die. What will replace it?

#139
post #122

Earlier quoted context omitted.

Lots of PHP folks call that a disadvantage... It's nice knowing I can mess with files and after pressing F5 I'll always have the latest version. Yes, ok, caches can get out of sync, but they're easy to clear. There are furthermore no good PHP deployment automations, things Rails and Python have because of the level of complexity.

You can (and people do) use Capistrano to deploy php code.

While you can, I've found Capistrano is full of rubyisms and makes inferences. Sure it can all be changed, but needs a power user to really use it.

Couldn't get it to work myself due to various issues related to running DirectAdmin control panel, and protections against symlinks it has built in.

Re: PHP needs to die. What will replace it?

#140
post #122

Earlier quoted context omitted.

You can (and people do) use Capistrano to deploy php code.

While you can, I've found Capistrano is full of rubyisms and makes inferences. Sure it can all be changed, but needs a power user to really use it. Couldn't get it to work myself due to various issues related to running DirectAdmin control panel, and protections against symlinks it has built in.

I had never used capistrano before, and still managed to get it working for a node.js project, which also involved Mono, c#, several monit scripts, etc. My config file is pretty big, and the documentation wasn't awesome, but at least it's working. If you want automated deployment, it's definitely worth the effort.
Post reply on HN