TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

PHP Sucks, But It Doesn't Matter

62 pointsby VinzOabout 17 years ago

16 comments

ardit33about 17 years ago
One reason PHP is so popular, before 2005 there were four choices:<p>Java --all frameworks sucked at the time (I had to work on struts, it was painful).<p>.net --tied to MS world, and the first iterations sucked<p>php --it was quick and dirty and easy to get started<p>cgi,perl, python, C++ --required higher level of expertise, and they were hard<p>php, was the sensible choice for something quick, and the more "primitive" state of the web apps at the time, demanded less from the framework/language being used.<p>Right now there is much more choices, and Python (Django), and Ruby on Rails can be really quick to get started on, therefore php is loosing it's main advantage, yet Django and Ror are much more sophisticated and maintainable on the long run.<p>Even Java now has some nimbler frameworks (Wicket, Stripes etc.)<p>So, right now PHP is a very bad choice to do anything significant, as it lost its advantages over time, yet it is a mess to work with.<p>But, the main reason we still PHP used so much, is that a lot of sites were build before 2005, and a lot of web devs are used to it, so as a language it will keep its momentum, but at some point it will run out of steam.<p>It seems that even the newbies now prefer Ror over PHP.
评论 #196031 未加载
评论 #196405 未加载
评论 #196027 未加载
评论 #196018 未加载
评论 #196082 未加载
评论 #195979 未加载
评论 #196183 未加载
sanjabout 17 years ago
Apropos, from <a href="http://www.joelonsoftware.com/articles/fog0000000006.html" rel="nofollow">http://www.joelonsoftware.com/articles/fog0000000006.html</a><p>"What I wondered was, what happens if you take top-notch C++ programmers who dream in pointers, and let them code in VB. What I discovered at Fog Creek was that they become super-efficient coding machines. The code looks pretty good, it's object-oriented and robust, but you don't waste time using tools that are at a level lower than you need. I've spent years writing code for C++/MFC and years writing code in Visual Basic, and let me tell you, VB is just much, much more productive. Michael and I had a good laugh today when we discovered somebody selling a beta crash-reporting product at $5000 for three months that Michael implemented in CityDesk in two days. (And we actually implemented a good part of ours in C++/ATL). And I also guarantee you that our Visual Basic code in CityDesk looks a lot better than most of the code you find written in macho languages like C++, because we're good programmers, and we write comments, and our variable names are well-chosen, and we do things the simple way, not the clever way, and so forth."
markbaoabout 17 years ago
Solving spaghetti PHP in spaghetti SQL in spaghetti HTML:<p>1. Learn how MVC works.<p>2. Write a basic MVC framework.<p>3. Zip it up, put it aside, and learn Symfony, CodeIgniter, etc.<p>(Writing your own framework is an incredibly good learning experience.)<p>Spaghetti code is solved (mostly) by structured organization, ORM, views that simply display data, and the separation of the MVC parts.
sethgabout 17 years ago
As a developer, I am frightened by PHP.<p>I assume that <i>it is possible to</i> write clean, maintainable, secure code in PHP. But if I sat down and tried to write a web app on my own in PHP, what are the odds that I would do it right--particularly w.r.t. security? If I look for tutorials and reference materials that teach secure PHP programming, how do I know which of these documents are written by people who actually know what they're talking about?<p>And after taking into account all the effort to learn and use good PHP practices, is PHP really more difficult than one of the Perl, Python, or Ruby frameworks?
评论 #196007 未加载
michael_dorfmanabout 17 years ago
An excellent statement, as far as it goes.<p>The question remains, though: for a given application X, to be developed now, what is a better alternative, and why?
edw519about 17 years ago
"PHP Sucks"<p>Anyone can say this (and usually does).<p>"But It Doesn't Matter"<p>Thank you. In any language war, <i>this</i> is the most important thing to say.
评论 #196028 未加载
评论 #196021 未加载
senthil_rajasekabout 17 years ago
This post to be honest is from someone who does not obviously use PHP on a day to day basis.<p>Why PHP? In the end the quote below summarizes its success,<p>-- begin quote -- In many ways, the IETF runs on the beliefs of its participants. One of the "founding beliefs" is embodied in an early quote about the IETF from David Clark: "We reject kings, presidents and voting. We believe in rough consensus and running code". -- end quote --<p>From the "Tao of IETF" <a href="http://www.ietf.org/tao.html" rel="nofollow">http://www.ietf.org/tao.html</a>
technoguyrobabout 17 years ago
To me, it seems PHP is the Windows of web languages. In many respects it "sucks", can be clunky, and has little to no elegance from a formal perspective, but it's everywhere and everyone knows how to use it. Thence lies its success.<p>(however, if you're willing to give up lambda's, some of the PHP frameworks like Cake are only mildly unpleasant)<p>P.S. Also, the author is inaccurate, as many of those functions are only included in certain modules and rarely found in common PHP builds.
评论 #196012 未加载
ambitionabout 17 years ago
The python code in the book Programming Collective Intelligence is aesthetically poor, with unclear naming, bad spacing, errors and some ugly duplication. But it doesn't matter. The algorithms work, the concepts get taught, and you still get to build your own little pageranking search engine in a single chapter.<p>Same deal with PHP. It seems that PHP gets the job done. (I say this never having coded anything significant in PHP.)
blueluabout 17 years ago
In the early days, I can still remember my perl scripts failing with the "Premature end of script header" error. If they would have patched perl to ignore the newline encoding, nobody would have used php. I can imaging lots of newbiews turned down perl because of this error.<p>Php really is a mess. 20 functions for sorting, settings in php.in (each php installation should react the same way as the other does), etc...
deanabout 17 years ago
Nothing to see here. Religious opinion. Move along.
chaostheoryabout 17 years ago
I'm not keen on PHP, but in its defense it is much less headache inducing than perl or as tedious as the Java/.NET world
Maascampabout 17 years ago
One thing many people seem to forget when discussing PHP is that if PHP vast library of built in functions doesn't do what you need, you don't have to live without, you can just write an extension, recompile, and you're in business. PHP allows you to write important logic in C, giving me yet another reason use it.
knarfabout 17 years ago
I once read "PHP takes 'Worse is better' to a new level." That about sums it up for me.
gruseomabout 17 years ago
<i>But It Doesn't Matter</i><p>It matters to me.
esabout 17 years ago
the main issue is in developer, not in language.
评论 #195982 未加载