Live data from Hacker News

PHP: A fractal of bad design

me.veekun.com

41–50 of 514 posts

Re: PHP: A fractal of bad design

#41
I completely agree with all of the author's points, but my day job is still PHP and I actually don't hate it so much now.

That being said, it's nice to be able to sit on the most version of PHP and use awesome frameworks like FuelPHP and Laravel. I would not really consider doing anything besides nice CRUD app's in PHP though.

Re: PHP: A fractal of bad design

#42
I'm going to be unfair and quote just two words from the article:

> empowered amateur

PHP is a gateway drug to web development. And that's awesome.

With almost every other popular web development language I've heard of[1], there's this grey area between "my app works on my local machine" and "my app works on the server" that is really hard to grok as a beginner. There's a reason entire businesses are built on the idea of making this easy.

With PHP? You get an apache box with PHP, you put the files up, and you're done.

For a professional web developer? PHP is probably nuts. I've purposefully left out things like PHP frameworks, setting up a database, or doing any sort've advanced web development. And yes, it is possible to create a large, successful, stable web app with PHP. It seems kind've hard given the legitimate criticism in the article.

But, honestly? Once you've started doing web development, you should be able to improve your own skills without the community pushing you. It's the people who are just starting out who need all the help they can get.

[1] Which isn't at all exhaustive. I'd love to hear about alternatives that are beginner-friendly.

Re: PHP: A fractal of bad design

#43
post #2

This is just another example of someone beating a dead horse (which has already been beaten) for page views. Next week we'll have another "bash php" post, and the week after that another. I wish people spent as much time creating new things as they did bitching. As well written as this article is, it contains absolutely nothing that hasn't been said ten thousand times already- in fact, most of this seems to be regurg…

Until people stop using PHP I welcome detailed critiques of the language. There are still enough PHP apologists out there that we can use all the ammunition we can get.

Re: PHP: A fractal of bad design

#44
post #37
post #19

"(And strictly speaking, Facebook isn’t written in PHP; it’s written in a C++ macro language with a striking resemblance.)" I'm a Facebook engineer who works on the HipHop compiler and HipHop virtual machine. It's in PHP, absolutely full stop. It's amazing how much the fact that g++ is involved somewhere in the toolchain confuses people in this matter. C++ is just an intermediate representation; the source language r…

Interesting. Redacted, with apologies.

Oh. I guess you weren't using poetic license.

Re: PHP: A fractal of bad design

#45
I can't really fault anything that was said in the article. What left me wanting was the ending. I was expecting the equivalent of the main character happily walking into the sunset. In other words, something akin to: "And now that we have established why PHP sucks let me tell you what I use and why. I use . Here are all the reasons for making these choices:"...

To me at least, an equally thorough treatment of what he might consider the "right" or "good" language would have made the time invested in reading the bitch-about-PHP feel more valuable. You'd walk away with at least one well-studied view for a potential direction away from PHP. As the article is currently written you are told all the reasons why what you are using is shit but not given any hint as to what you might consider looking into.

Re: PHP: A fractal of bad design

#46
post #30

I got into the web space through WordPress and naturally progressed into learning PHP. There are times that I wish I could work with another language just as well as I can in PHP. I've attempted to learn Ruby. I know C++/C#/Java/Objective C. Yet I still come back to PHP. I can't explain it. I like PHP. I understand PHP. There are nice people willing to help me with PHP. PHP does what I ask. It's not the greatest. It'…

The day you learn Python and see the light, you will look back and wonder, "Oh, God. Why?"

Re: PHP: A fractal of bad design

#47
post #12

> 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 popu…

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.

Re: PHP: A fractal of bad design

#48

My goal is to move away from PHP completely by 2013 for my websites. I've recently been toying around with various methods of tying C++ to a web frontend, with varying degrees of success. My current favorite method is to use mongoose to create a very simple HTTP interface for any C(++) project (mongoose is great!) and then use AJAX and JSON for any and all communication to and fro client and server. However, this lea…

Have a look at the OK Web Server[1]. It has a clever design that cleanly separates application and HTTP concerns and the default libraries are written in C++.

[1] https://github.com/okws/okws

Re: PHP: A fractal of bad design

#49
I admit, PHP sucks. But there is one thing it has going for it. It's simple to configure and secure a server that your general userbase can run applications on. I work at ITECS, the Engineering IT department at NC State University. ITECS is responsible for maintaining the server infrastructure for dozens upon dozens of university Web sites, most of which have dynamic content. Not to mention the people server, which anyone affiliated with the College of Engineering can get directory space and a MySQL database on.

I was once talking to our Systems people about, why not allow Python applications. They said that every time they have experimented with allowing CGI scripts in any language supported by their Web servers, someone has always found a way to exploit their sandbox. With PHP, the applications can still get exploited, but they have never had a breach that affects the servers themselves.

So if you're a startup or a major tech company who can spend time customizing a Web server and trust everyone who has access to it, then you're crazy for using PHP. But if you're a college with 8,000 students, almost 1,000 faculty, and a bunch of support staff in addition, and a good quarter of them need Web sites, PHP's pretty much the only option that will keep you sane.

In my opinion, that's something that seriously needs fixing. But it's certainly an explanation for why PHP is still around now.

Re: PHP: A fractal of bad design

#50
post #35
post #12

> 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 popu…

"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…

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