PHP Sucks, But It Doesn’t Matter: Jeff Atwood essentially closes the “PHP sucks” argument by agreeing with it, then explaining why it doesn’t matter.
The TIOBE community index I linked above? It’s written in PHP. Wikipedia, which is likely to be on the first page of anything you search for these days? Written in PHP. Digg, the social bookmarking service so wildly popular that a front page link can crush the beefiest of webservers? Written in PHP. WordPress, arguably the most popular blogging solution available at the moment? Written in PHP. YouTube, the most widely known video sharing site on the internet? Written in PHP. Facebook, the current billion-dollar zombie-poking social networking darling of venture capitalists everywhere? Written in PHP.
Notice a pattern here?
Some of the largest sites on the internet — sites you probably interact with on a daily basis — are written in PHP. If PHP sucks so profoundly, why is it powering so much of the internet?
The only conclusion I can draw is that building a compelling application is far more important than choice of language. While PHP wouldn’t be my choice, and if pressed, I might argue that it should never be the choice for any rational human being sitting in front of a computer, I can’t argue with the results.
I’m actually beginning to like ASP.Net, but you have to wonder why very few of the big sites — on the scale that Jeff mentions above — are written in it. ASP.Net owns the enterprise, but I don’t see any of the Web 2.0 darlings rushing to it.
Say whatever you want about PHP, but it’s easy to do stuff in. Yes, it’s easy to do stupid stuff, but it’s easy to do about everything else in as well.
ASP.Net is Jacqueline Kennedy, while PHP is Marilyn Monroe. Sure, you couldn’t take Marilyn to a state dinner, but she was probably a hell of a lot more fun in general.
What a terrible argument. You know what? If grossly polluting gasoline engines suck, why do most cars use them?! Huh, they must have something going for them.
Oh, right, they're leftover from earlier days and the cost to transition is huge.
The reason places like Digg and Facebook are written in PHP is because they started small with no actual plan to be huge, and at this time their code and expertise investment is too huge to switch.
So, yeah, PHP won't kill a business. But if you're starting from scratch with a plan for future growth, it's still a terrible technology choice.
But if you’re starting from scratch with a plan for future growth, it’s still a terrible technology choice.
I completely reject that statement. Talk to Yahoo. They made choice after choice to use PHP even after they got huge.
We're writing a commercial app from scratch now, and we chose PHP over everything else. Are we just stupid, or are we fluent in nine different languages (Rails and .Net included) and decided that PHP offered the most advantages and the least drawbacks?
Care to share what you see as the advantages of PHP over the other 9 languages?
Asp.Net owns the enterprise? Only if they are going out of business, have more money than sense, or I.T. isn't an important to their business.
Java and PHP rule the enterprise. Phone companies, banks, insurance, you name it.
Asp.Net only rules in State Government. Which is why you have to use Internet Explorer to get your license.
Why not Asp.Net?
1) Being on Windows is too restrictive. Mono is a joke.
2) Stability of the platform. It's a complicated mess.
3) Overly Complicate. Vista and IIS 7 aren't helping.
4) Ability to influence the platform direction. Vendor Lock-in.
5) Ability to fix bugs in the platform. Windows is closed source.
6) Tools: Visual Studio is good IDE when it works. But it's only good for Asp.Net coding. I need a more flexible IDE.
I just started PHP, and I think it's great. I tried ASP.Net while I tried PHP, and I thought that PHP was MUCH better. There's no way I'd pick ASP.Net over PHP. The great thing about PHP is simplicity. It's so much easier than ASP!
Also, I hate the closed source thing. That's VERY annoying! PHP can do so much (simple to complex) without an extensive knowledge. I'm 15 and I can use it fine. Sure it's not the main point of my website, but it's good for password protection and upload scripts for me.
I think that that "PHP compared to gasoline" bit is quite unintelligent. (That's a real word by the way.) Gas hurts things, PHP doesn't cause crashes or extra files etc. ASP.Net does. I just got a huge book on ASP.Net (2000+ pages) and almost half (850+ pages) of it is how to fix errors! I got an e-book on PHP which is 1200 pages and only 50-odd of how to fix errors! I've never gotten a PHP-engine caused error. The only time you get one is when you TRY to cause one. (e.g. BitChangers)
PHP rules the marketplace. Plus it's COMPLETELY free! Which is great :) Most webservers offer it too. I have a free hosting program (WAMP, powered by Apache) that I use to run my website, and PHP is built in! Because it's free!
PHP will win out, unless of course someone smart comes out with a new language. Maybe one of those people who own the open-source Linux platforms will make a web-enabled language similar to PHP that people can use at their leisure. That'd be great wouldn't it?
Ubuntu + PHP for the win! (Great for using as a server!)
By the way I'm pretty sure that this site uses PHP.. Hehe..
I just got a huge book on ASP.Net (2000+ pages) and almost half (850+ pages) of it is how to fix errors! I got an e-book on PHP which is 1200 pages and only 50-odd of how to fix errors!
Cory -- I'm pretty sure someone is going to turn this comment against you pretty quickly, so be forewarned. What you said here probably proved the exact opposite of what you were trying to say.
By the way I’m pretty sure that this site uses PHP.. Hehe..
Sort of. It uses Perl to generate PHP pages. It's odd, I know.
Google uses Python. Period. :)
Actually, there is some merit to the PHP and gasoline comparison. In my (fairly extensive) experience, what PHP seems to have done is 'pollute' the web-applications industry with awful coding practices (OK, OK, I know that PHP didn't do this and that the people using it did). I probably spend at least 80% of my development time having to do deal with horrific legacy code written by people who just picked up what they needed to in order to get the job done.
And there is the problem. PHP usually DOES get the job done. Just. But if you are't careful with it, you can write stuff that will force future developers (like me) to refuse to spend more than 4-6 months in a single job before they get sick of it and quit.
God how I wish that Java had been the defacto standard used by everybody.
God how I wish that Java had been the defacto standard used by everybody.
You had me right up until the end there.
I think the strength are also your weaknesses. In php cases since it does not restrict a programmer to code in a particular style, alos their isnt the peer pressure to follow certain coding style be it mvc or oops its easy to create messy code.
php code doesnt suck, look at wordpress code, its clean and probably as good as anything you will see.
If anyone sucks its the programmers who take the lazy way of writing bad code.
But then again, since its easy for any average programmer to start programming with php its easy for startups to train and replace programmers when they do not have huge resources.
Php has its place, it will always have its placed. Most starups that make it big will probably be php too.
Adi www.appliedeye.com
php code doesnt suck, look at wordpress code, its clean and probably as good as anything you will see.
Yeah, I have to disagree with you there. WordPress is getting better, for sure, but traditionally it has been a huge mess. It's one of those project that grew so fast and had so many contributors that the codebase just got clogged up with all sorts of stuff.
Again, I know that WordPress is getting better fast, but I wouldn't hold it up as a paragon of great PHP code.
I've read so many posts on why PHP sucks. Well it isn't sucking so much when I can kick out dynamic websites and collect a nice check in no time. For small to medium size applications I wouldn't use anything else, because I know I can code so much faster in PHP = take on more work = more money.
Now for critical/enterprise/military/medical/real time applications, I think you have to use a very tight true programming language. But for a flipping web site, come on, why kill yourself. Just use good practices and you will have a lot of happy customers and maintainable code.
The Personal Home Page language (that's what PHP was christened as) gives developers a simple means of mixing of procedural code with markup. It has a gentle learning curve, and it enjoys widespread support. It requires little or no programming skills to get started. Having said that, when a dynamic web page is simply the suface area of a complex underlying application, the lion's share of the application should be written in a typesafe, object-oriented language, with a large eco-system of tools and class libraries. I certainly have no trouble with PHP or Ruby, but I'm also proficient in C# and Java and I don't fall victim to the Golden Hammer anti-pattern: when you are a hammer, everything looks like a nail. I know where Java/C# shine and where PHP sucks, and vice versa.