Hacker News new | past | comments | ask | show | jobs | submit login

> PHP ... bad design

PHP wasn't "designed" ... it evolved. Pieces were added, here and there, re-factored, deprecated, etc. etc.

PHP is a natural language. It wasn't fabricated at some university, nor in the lab of some billion dollar company. It evolved.

That is its strength. It is the most adaptable language around. It can be used for anything and it has been used for everything.

And that is why it is the most popular programming language.

Not popular with stuck-up pretentious twits who have nothing better to do than to offer their opinion to the world. No, it is popular with people who build things and get things done.

That's what it's for. To build. If the clown who wrote that article had spent as much time programming, as he did writing that drivel, we might have something useful to praise him for. Even if it was written in PHP.




> That is its strength.

No. That's it's weakness. Programming languages are not like natural languages. PHP did not emerge spontaneously from conversations amongst PHP programmers -- people actually sat down and wrote code. When that happened, they had the choice to exercise some degree of higher thought. They did not do so.

PHP is a perfect example of how local optimality -- slap on the first thing that "works" -- can lead to wildly suboptimal global outcomes. PHP is a system that is a constant state of partial failure.

> And that is why it is the most popular programming language.

This is demonstrably false. Folk didn't adopt PHP because of some hand-wavy, post hoc, revisionist bullshit about linguistic evolution. They did so because in the late 1990s it was not possible to run multiple mod_perl applications on a single Apache process, but mod_php could do so.

That's it. Perl's horse wasn't shod. The rest is merely a painful, expensive, misbegotten parade of path dependency.


> They did so because in the late 1990s it was not possible to run multiple mod_perl applications on a single Apache process, but mod_php could do so.

When it comes to single factors explaining its success in the 1990s, the one I've heard cited more often is that you could embed PHP into HTML documents with the <?php ...> kind of deal, and a lot of shared hosts enabled that by default, making it by far the easiest way to get server-side scripting up and running.


Plus the deployment model: "here's your FTP login".


Yep, trivial deployment model and trivial stack integration so every free host or ISP providing 20MB "web hosting" to users could give out PHP execution as well.


The implicit assumption here is that the world doesn't change. PHP comes from the world of Perl, C, and ASP/VBScript. Procedural programming, embedded HTML, etc. It's impossible to predict the future.

Other languages have evolved as well; Python has changed significantly from it's earliest incarnations. And, during the time of early PHP, Python was a complete failure as web language.


Again, Python et al have not evolved. They have continued to be modified and refined by the deliberate application of thought, particularly the kind of insightful, discursive thought that programming language design calls for.


The point is, Python wasn't (and perhaps isn't) perfect. Mistakes were made. Fixes introduced. PHP continues to be modified and refined as well. PHP developers are hard working developers with a difficult job; I can't help but think you're being insulting to them.


The difference is that at each stage, Python's designers have exercised more global reasoning than PHP's.

The PHP bar for inclusion, for most of its life, seems to have been "it compiles".

I don't think it's possible to directly compare PHP and Python and not draw the conclusion that PHP was basically slapped together out of any old thing that came to hand without any degree of planning or foresight.


The problem is that many early design decisions were made when PHP was a small personal project with the goal of accomplishing something immediately. It wasn't intended to be object-oriented. But that was a long time ago. Many of the points made about PHP design are ancient decisions and difficult to change because of backwards compatibility.

I'd say it's entirely unfair and incorrect to say the bar for inclusion has been "it compiles". Even some of the decisions made for PHP4, which I disagreed with, were debated endlessly.

Take, for example, the introduction of namespaces into PHP -- it got a lot of flack for using an additional character but if you study the design carefully it's nearly impossible for it work any other way in PHP. You might look at that and say there was no planning or foresight (or that it was simply the easiest solution) but that betrays the truth.


This. +1000 if I could.


PHP is a natural language. It wasn't fabricated at some university, nor in the lab of some billion dollar company. It evolved.

That is its strength. It is the most adaptable language around. It can be used for anything and it has been used for everything.

Programming languages are not human languages. Programming languages are engineering tools. Would you cross a dangerous river on a shaky, lashed together bridge that had "evolved over time from a single plank"? Or would you rather cross via well designed, properly tested bridge, even if it was made from the same materials as the evolved design?


Well, if you take the engineering analogy in a somewhat different direction, you end up with all the structures we ever created before we mastered statics and material sciences. Those bridges the Romans built were evolved patterns based on trial and error of previous designs, where the last design was the testing.

Anyhow, just something to ponder about.


Those bridges weren't continually "enhanced" by slapping on more stone and wood (at least not the ones that remained standing for long). Each bridge was a fresh design, based on the best practices of the day.

Kind of like new programming languages.


20-something centuries ago, without the benefit of calculus or Newtonian physics, Romans were better engineers than Rasmus Ledorf.


Survivors bias, I think. We just don't see all those buildings/bridges that collapsed.

And they put bridge designers beneath the bridge when legion crossed it for the first time. If we started to do equivalent for programmers, we would have much better code quality :)

And in regard to programming language design we don't have calculus, either. We're just experimenting, and trying to repeat what works.


> Survivors bias, I think

That's definitely part of it. But the Romans really did care about engineering and took it seriously -- one of the earliest writers on architecture was Vitruvius. What did he say about buildings?

That they should be safe, functional and attractive, in that order.

> And in regard to programming language design we don't have calculus, either.

Church and McCarthy would like a word ...


The prevalence of exactly this attitude is why we need all the informed PHP bashing posts we can get. It amazes me how eager people are to wear their ignorance like a badge these days.

Python, Perl and Ruby also evolved organically without (at least initially) the help of any corporate sponsor. Yet none of them are the pig's breakfast that PHP is.


> PHP wasn't "designed" ... it evolved. Pieces were added, here and there, re-factored, deprecated, etc. etc.

We are all aware of that. We don't like that. Not because of its genesis, but because of the result of that process.

> PHP is a natural language. It wasn't fabricated at some university, nor in the lab of some billion dollar company. It evolved.

> That is its strength. It is the most adaptable language around. It can be used for anything and it has been used for everything.

You have to purposefully design a language that can't be "used for everything". And boy, the way PHP has "adapted" could be done by any language or designer or committee if they were just to lower their standards enough. But most haven't, and have adapted with more success. Why did PHP barely get (half-assed) closures just now?

> And that is why it is the most popular programming language.

Where?

(Though I think IHBT)


I love a good, high quality rant; this is a very good one. Kudos.

I was starting to entertain the idea of doing a project in PHP, thinking it can’t be that bad. Thanks for convincing me otherwise. The inconsistencies you listed would drive me up a wall.

It does remind me of the Unix Haters Handbook (http://en.wikipedia.org/wiki/The_UNIX-HATERS_Handbook); I used to have my very own copy; I would read it and laugh and think how lucky I don’t have to use Unix on regular basis.

Of course, that was back in the day; now I spend a lot of time at the command line on my MacBook Pro.


"It evolved" is a reasonable excuse for an 0.7 product, or an ecosystem like the Internet, where no single entity is in control.

But when you've gone through 5 major versions over a decade, I don't think you can say, "Well gosh, it jes' growed that way." That takes it from "evolved" to "poorly planned".

Also, I wouldn't lean too hard on "most popular". Bud Light is the most popular beer and American Idol is the most popular TV show. "PHP: The Bud Light of programming languages" is not really helping your case.


Actually, now that I think about it, PHP just might be the Bud Light of programming languages.


If the clown who wrote that article had spent as much time programming, as he did writing that drivel...

You had some interesting points about pragmatism and emergent design, and then you had to go with this aggressive insulting bullshit. Come on, we can do better than that.


Spend some time on the PHP developers' mailing list and watch exactly how the language evolves. You will lose that feeling of awe and reverence pretty quickly.

And every language is designed. This one happens to be designed by committee, with all the attendant issues.

Also, nobody is arguing about whether it is popular. (Although, "most popular programming language"? What planet do you live on?) We are not arguing whether it can be useful. We are discussing whether it's a good language. Try to follow along.


Exactly!

One of the reasons I hate Ruby is that nearly every person I've come across that likes it is exactly how you describe. It seems to be part of the Ruby culture.


Exactly! That's the reason I hate broccoli -- every person who tries to feed me it seems concerned that salt and vinegar potato chips are the only vegetable I eat. It seems to be part of their whole culture.

They're clearly just potatohaters.


I never said I don't use other languages. You are making assumptions.

I'm sorry if you like using Ruby and the majority of the community are pretentious assholes. I will never use Ruby or Rails for any project.

I can tell I must have gotten a little too close to home.


Huh?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: