Hacker News new | ask | show | jobs
by foolinator 5183 days ago
I know why it's successful.

I remember when PHP was becoming popular. It allowed for inroads to code from front end designers who hated coding in Flash at a time when academia-based Java people were running all the big websites. If you wanted to hack up and put up a website, you can do so in a few minutes with a LAMP stack where a Java stack needed some lessons in Java.

Same is pretty much true today, but it's 10 languages instead of Java.

You know, Java was the same way. It was originally made in the 90s as a language made for embedded devices (toasters, refrigerators, etc). No one expected it to be a web language.

But Java offered something that was attractive to C++ coders: garbage collection. that made learning the language a lot easier. C++ people joked about Java never becoming popular. It crashed a lot! (core dumps - a common issue in PHP)

PHP reminds me a lot of what Java was 10 years ago. It's not as well put together as Java was. And it too took about 8-10 years to introduce templating.

My point:

1) PHP is popular because it has a more welcoming barrier of entry into coding.

2) PHP's problems appear the same to me as Java's problems 10 years ago.

That's all. Not saying one is better than another. Use whatever the fuck you want. I use both so as long as my employer pays me. Tell me to code mindfuck and I will. As I get older, I think I hate them all.

3 comments

I remember that PHP became popular because of mod_php. If you wanted to script a web application on Linux or UNIX your choices were either Perl with CGI or a much faster PHP with mod_php.

It was incredibly easy to setup both in production and for development - hence the LAMP stack and the thousands of cheap shared hosts that had PHP enabled, which lead to a lot of pre-install applications being written in PHP.

Other web applications only recently became easy to install, and they didn't beat 'ftp into the site and drag files over' until cloud platforms and virtualization.

They still haven't beaten PHP in ease-of-deployment. I've been writing for the web in Python for 2 years. Deploying your own server is a full-time job.

The only thing that's getting better is that things like Heroku now exist. Heroku makes it insanely easy to deploy Python, compared to deploying on your own server. It's still harder to do than FTP + copy files, which most people know how to do.

"(core dumps - a common issue in PHP)"

Ummm.... I've been working with PHP for 16 years, and I could count the number of coredumps I've had in production on one hand (maybe 2). Early on, when compiling extensions by hand, I'd get some when I compiled something wrong, but that was always in test areas on dev machines.

If 'core dumps' were 'a common issue', I doubt it would be as widely used as it is now.

Bahh.. it was at where I worked. It was because we relied on C libraries that PHP connected to. When PHP is slow, they make links to C libs to get speed. Java did the same with JNI. PHP simply isn't fast enough in some situations where C libs are necessary to hook up with. (private message me if you disagree.. I'll be glad to go into details)

We were typically getting up to 200 req/second on our stack. So it was pretty heavy traffic to begin with. We solved the core dumps though. And the java core dumps were for the same reason (necessary to connect to JNI).

Sure... when dealing with custom C code and hand-rolled non-vanilla PHP, I can see that happening. Understand that your experience was in the realm of the .01% of PHP usage. 200/req second isn't all that outrageous for run of the mill PHP (depending on hardware) but when you're throwing in custom connector stuff on top of that, yeah, you'll get core dumps. :/
That's all I said though, is that it reminded me of my Java years.

And yeah, connecting to C libs is commonplace in large PHP places. In fact, that's how PHP gets a lot of it's work done to be quick. Your ".01%" is a number you're throwing out of your ass and you know it.

I'm not surveying PHP usage, merely telling my experience. If you work on a website and need to connect to an external system that only has a C lib, guess what? You're going to connect using C libs.

> Tell me to code mindfuck and I will.

I believe you referred to brainfuck, just for the record.

> As I get older, I think I hate them all.

There is some deep pessimism in the software world that I feel constructive.

When engineers talk about how much they hate the tools even they don't have to use, I think it shows the care they have toward the profession.

Bahh.. Don't be so patronizing. I'm a nerd dude. I was joking when I said I hate them all. I'll fuck Java and PHP in a 3some if given the chance.

I'm saying as long as I get paid I'll do the job because I'm an hourly coder (pays more, have mouths to feed). I do plenty of "fun" work and open source work.

It's the same reason people in any field put down things - they like to feel superior by putting down the tools that others use, thereby increasing their own relative stature.
I hate people who put down people. They're assholes and stupid.

Just kidding dude. I was just joking when I said that. I love coding. I'd fuck a node.js program and even let XML lick my balls at the same time.

On the other hand, you can generally complain the longest about the things you know the best.
There's also a "familiarity breeds contempt" angle.