News for hackers. Stuff that matters.
Re:PHP: the quiet powerhouse by chaostheory on Wednesday June 13, 2012 @07:12PM (#4108975)
Back when all you had for choices were Perl, Java, and C++ it was easy to see why PHP got big. However there are issues with starting out on PHP now:

1) It's really only meant for web development.

2) There are other languages now that are simple to learn, flexible (more than just for web apps), and powerful (Python, Ruby, and now even Javascript)

Unless PHP has another major evolution, like its move to OO; (or unless I just missed something else big) I just don't see the point of using it unless you or your company been using it for years already. This article doesn't have any real compelling arguments.

Maybe all of this will change once Facebook releases Hiphop VM AND people actually start using it. To this day, I'm not sure why no one started using Hiphop enmass and why people love using the inefficient eval method. O yeah there's also an issue with PHP and logic dealing with concurrency, in that there isn't a good way to distribute work within an app. Then again I could be completely wrong.

Re:PHP: the quiet powerhouse by mgkimsal on Wednesday June 13, 2012 @08:29PM (#4109219)
I've been working with PHP since 1996 and rarely see eval being used. I've worked with hundreds of companies training PHP developers, seen inside (and written) some very large codebases handling millions of dollars of transactions, and don't recall seeing eval in any of them.

"it was easy to see why PHP got big"

It's easy to see why it's staying big:

1. cheap shared hosting to get started 2. most hosts offer one-click installation of any sort of application people need on the web (blogs, shopping carts, calendars, social networking, file hosting, etc) 3. 15+ years of knowledge about what works and what doesn't when attempting to scale PHP to large needs. 4. ubiquity which keeps a large pool of reasonably priced talent available, which perpetuates the cycle.

When there's a competitive language that can be placed in a directory as FOO.abc, I can hit it as /FOO.abc and have it execute, with html content type sent by default, it'll have a running jump at dethroning PHP.

The barrier to entry is the lowest out there, but the heights it can scale to are facebook-level and beyond.

Re:PHP: the quiet powerhouse by chaostheory on Thursday June 14, 2012 @01:55AM (#4110017)
> I've been working with PHP since 1996 and rarely see eval being used.

For some reason most of the major frameworks use it, hence their incompatibility with hiphop; then again I could be wrong.

> 1. cheap shared hosting to get started

One can argue that all of the major languages have access to this. PHP doesn't have an edge in this area.

> 2. most hosts offer one-click installation of any sort of application people need on the web (blogs, shopping carts, calendars, social networking, file hosting, etc)

With the rise of the cloud hosts and automated config, as well as more automated tools available (e.g. Chef, Puppet), this is a temporary advantage. Deploying on Linode and Heroku and (insert cloud host company) are getting easier and easier.

> 3. 15+ years of knowledge about what works and what doesn't when attempting to scale PHP to large needs.

No argument here. My points only apply for people starting now, and not for PHP vets.

> 4. ubiquity which keeps a large pool of reasonably priced talent available, which perpetuates the cycle.

No argument here either. My points were being made for individual programmers who are just starting out, and not for companies.

Even from the point of a company though, PHP's current lack of flexibility lowers the chance of innovation imo. The other dynamic languages are just as easy to learn and they just offer more than PHP does.

Re:PHP: the quiet powerhouse by mgkimsal on Thursday June 14, 2012 @06:30PM (#4113874)
>No argument here. My points only apply for people starting now, and not for PHP vets.

I wasn't meaning for people - I meant 'the industry' as a whole (or a large segment) - standing on the shoulders of giants and all that.

>> 1. cheap shared hosting to get started

>One can argue that all of the major languages have access to this. PHP doesn't have an edge in this area.

Really? I think there's far more options for people with 'PHP' in the hosting arena. It's not that you can't use other languages/platforms, but ... competition for hosting basic PHP stuff is massive - not so much for Ruby/Rails, Python, etc. along with all the extra stuff you'd need (community libraries and such) - much more is baked in to PHP hosting than you get with the majority of other platforms. Java in particular is expensive to host anything useful because it's RAM hungry.

re: eval - do you have pointers to examples? I just grepped Zend Framework 1.10, and there was 1 eval, in Serializer/Adapter/PhpCode.php, with a warning that it shouldn't be used.

Re:PHP: the quiet powerhouse by chaostheory on Friday June 15, 2012 @01:22PM (#4117562)
> I wasn't meaning for people - I meant 'the industry' as a whole (or a large segment) - standing on the shoulders of giants and all that.

Ruby and Python aren't very new. There are giants there as well. If you're going to make that argument, then Java has a bigger advantage.

> I think there's far more options for people with 'PHP' in the hosting arena.

As I've already said, I don't disagree. I just said that this advantage is going away. Personally I'd also rather go for host that's mid-ranged as opposed to hosts that are in the race to the bottom. I don't think paying $10 more a month is exorbitant especially if it buys you a lot of language power and it takes over more sysadmin duties from you.

> re: eval - do you have pointers to examples?

Every major PHP framework uses it. How do I know? To my knowledge you can't use any of them with Facebook's hiphop out of the box. I suspect this is one of the main reason's no one uses hiphop even though it gives you a good deal of performance gains for PHP.

Re:PHP: the quiet powerhouse by mgkimsal on Friday June 15, 2012 @02:04PM (#4117784)
"Every major PHP framework uses it. How do I know? To my knowledge you can't use any of them with Facebook's hiphop out of the box. I suspect this is one of the main reason's no one uses hiphop even though it gives you a good deal of performance gains for PHP."

Zend Framework 1.10 - a fairly high-profile framework - has 1 instance of eval in a component I've never known anyone to use. I suspect hiphop has a few other issues with it, but... even more to the point, I don't think most people think they need hiphop. It's an unknown - it's a compilation step, and adds a couple extra steps of complexity. People can get a lot of performance gains by using Zend Server caching or APC with far less unknowns vs digging in to hiphop.

Additionally, hiphop has had some issues with postgres/pdo, closures, imap and more PHP stuff over the last year or so. It's a nice thing from facebook, but it was written for their own problems, not as a general use tool for everyone. If it can evolve in that direction, the adoption may go up. Until then there's far more well-tested ways to improve your performance of PHP.

Re:PHP: the quiet powerhouse by jmathai on Wednesday June 13, 2012 @07:35PM (#4109051)
Agree with all your points except this one.

>> Maybe all of this will change once Facebook releases Hiphop VM AND people actually start using it.

The argument that PHP doesn't scale is a strawman. To scale anything to the likes of Facebook or Google you have to have serious architecture in place regardless of the language you choose.

Re:PHP: the quiet powerhouse by chaostheory on Thursday June 14, 2012 @01:50AM (#4110007)
I wasn't thinking of scale. Correct me if I'm wrong, but wouldn't hiphop VM essentially expand PHP from just being a web language into something more?
Re:PHP: the quiet powerhouse by jmathai on Thursday June 14, 2012 @03:38AM (#4110265)
I stand corrected. I hadn't thought of it really. But the thought of PHP for non-web kind of makes me cringe even if it's translated into another language by an intermediary. For sanity sake I'm going to assume NO :).