7 ms·
The only thing actually wrong with PHP, is that it's popular but not cool. And that's a terrible place to sit for any product. It runs half the Internet quite
by adventureful 14y ago
The only thing actually wrong with PHP, is that it's popular but not cool. And that's a terrible place to sit for any product.
It runs half the Internet quite well, but if you went by the posting on HN, you'd think it was Windows Vista.
I've probably read every article critical of PHP that has hit the front page of HN in the last few years, and the one thing they all have in common is the vague refrain that PHP is a broken language. And yet the gap between tangible proof of that being the case in real world use and the gossip of it supposedly being true, couldn't be wider.
- maratd 14y ago> The only thing actually wrong with PHP, is that it's popular but not cool. Hey now, we're all human. Even engineers. As soon as something becomes popular, it is no longer cool. Cool is the next popular. Cool is being different. That's just how things work. Apache is slooooow (NGINX is cool!). MySQL is retarded (Postgres is cool!). PHP sucks (Python is cool!). Red Hat is lame (Ubuntu is cool!). See a trend? The tech that sucks is the most popular and well established. The tech that's cool isn't popular. It has nothing to do with any objective qualities of platforms. It's all about being a part of the cool croud! Remind you of high school much? Now, if this is just a hobby, who gives a shit? Roll with the cool kids. If you're starting a business, be aware that the future welfare of your family is relying on your decisions. Think real hard about that.
- denysonique 14y agoUbuntu is more popular than RedHat Linux
- maratd 14y agoNot for servers. Which is what we're talking about.
- calinet6 14y agoI was a bit doubtful, so I looked it up... turns out you're only somewhat right: CentOS + RHEL are about 40% together (28.7% + 11.6% = 40.3), but Debian + Ubuntu are over 50% at (30.8% + 19.8% = 50.6). Arguably Debian is not Ubuntu (which is why I say you're somewhat right), but it is just what Ubuntu sysadmins grow up to, and has even more of a cool underground factor, despite being the most popular server distro. Of course RHEL and CentOS are the same thing as well. Source: http://w3techs.com/technologies/details/os-linux/all/all http://w3techs.com/technologies/details/os-linux/all/all (accuracy not entirely trusted, but it appears roughly accurate)
- jeltz 14y agoI have heard that there is a geographical difference where Redhat is more popular in North America while Debian is more popular in Europe. No idea if it is true though.
- j_baker 14y agohttps://en.wikipedia.org/wiki/Association_fallacy https://en.wikipedia.org/wiki/Association_fallacy Just because a technology is "cool" doesn't mean that you're acting like a high schooler for using it. Nor does using non-"cool" technology make you an adult.
- maratd 14y agoI would think that not quoting Wikipedia articles in a conversation makes you an adult, but what do I know ...
- j_baker 14y agoI'm assuming you don't have any arguments left because you're needling me on my wikipedia link rather than addressing anything I actually said. If that's the case, you're really not adding anything constructive to this conversation.
- arms 14y ago> Now, if this is just a hobby, who gives a shit? Roll with the cool kids. If you're starting a business, be aware that the future welfare of your family is relying on your decisions. Think real hard about that. Truer words have never been spoken. When you think about it that way, these types of arguments about why language X rocks/sucks become trivial and unimportant. I like to geek out over languages and technologies as much as the next guy, but there needs to come a time when you put your foot down and make a decision based on more important reasons than personal preference/feelings towards a language.
- calinet6 14y ago> It has nothing to do with any objective qualities of platforms. The problem is, it often does take into account objective qualities. The downsides of popular platforms are often ignored because they carry with them all the advantages of popularity: good support, a well-established community, a wealth of experienced people you can hire or draw upon. These are not "objective qualities" of the technology, but real side-effects of popularity. In fact, you could say it's a technology's popularity that fools you into ignoring many of the objective qualities of the platform. I think part of tech hipsterism (which, let's face it, is what you're talking about) is a rejection of this groupthink, and a return to true technological thinking. It's the ability to say "we don't care what's popular, we're just going to look at what works again and see where we end up." I think this very idea is considered 'cool' in the tech world because we tend to like people who think logically about their problems and don't just blindly follow what people have already done. We like people who look at lesser-used technologies (which all of the "cool" tech you listed above actually are) just on their technical merits alone. This is, perhaps, one reason they're considered cool; because it takes actual thought to break away from simply using what everyone else has used for years. So I think you have noticed a definite trend, but I don't believe it's as purely social as you imply. That said, "be aware that the future welfare of your family is relying on your decisions" is an argument that's used in so much Enterprise software that it's almost scary. Often the most popular, most entrenched, least risky, biggest company with the largest pockets wins because the CTO can't be blamed for fucking up that decision. It's an incredible driver of technological stagnation in the Enterprise world. It is great to think through your decisions to their far-reaching impact, but be thankful that all of technology is not driven by that kind of strictness, or we'd never use anything new.
- laconian 14y agoThere's a delicate balance between healthy skepticism that comes from experience, and enthusiasm for trying new things. Going with cool new things for everything is very risky. This is terrible for established businesses, it's great for startups with no legacy and no pressure to maintain inertia. There cultural differences are endemic to the realities of both types of businesses and aren't just the product of politics.
- lucian1900 14y agoBut the problem is MySQL and PHP are objectively, measurably much worse than the alternatives you have listed. Cool-ness biases are perhaps not so easy to distinguish from justified ones.
- cellularmitosis 14y agoI'd like to extend your claim to Redhat as well. I won't make the comparison directly to Ubuntu, but I will compare it to Debian. And in the realm of server-oriented tasks, Debian is hands-down a better option, from the point of view of a sysadmin. I was a linux sysadmin at a university for 6 years, and I used linux personally for a decade (before switching to iOS dev). During that period, I've had brief, frustrating encounters with Redhat. It's not that it is unusable -- anything which can be done on Debian can be accomplished on a Redhat box. It's death by a thousand little annoyances, which is exactly the argument against PHP, so I think it's an "apt" comparison (pun intended). For example, * How do you restart apache on Debian? "/etc/init.d/apache restart". On Redhat? "/etc/init.d/httpd restart". Ah, so Redhat is in the habit of renaming all of their init.d scripts after the protocol of the service? Nope, turns out they only did that to Apache's script. WTF? * While we are picking on Redhat's Apache, they also chose to pollute /etc with a bunch of crap which doesn't belong there. Symlinks to /var/log/httpd, /usr/lib/httpd/modules, /var/run, etc. So now, when I grep /etc for something config-related, I pause and think "why is this grep taking so long...", and then a bunch of crap from /var/log spews onto the screen. Thanks, guys... * Still on the Apache kick, they decided to make the default permissions drwx------ for /var/log/httpd, with root as the owner. Really? Root is the only person who will ever need to look at those logs? Perhaps chgrp'ing to adm would be more sensible? * Which leads to another problem... because they put their WSGI sockets in /var/log/http (WTF?), which is... only accessible by root. Wonderful, so now I have to reconfigure all of my WSGI processes to stick their sockets into some other location, like /var/run. On Debian, this "just works". * The package maintainer of util-linux arbitrarily decided to remove cfdisk because it was a "pile of junk" (https://partner-bugzilla.redhat.com/show_bug.cgi?id=53061 https://partner-bugzilla.redhat.com/show_bug.cgi?id=53061 ). Really? Because every partition I've created on Debian for a decade worked just fine, using cfdisk... * There is (was?) no "vim" package. On Debian, to install vim, you type "sudo apt-get install vim". On Redhat, you type "sudo yum install vim", then go search google for a few minutes, and then type "yum install vim-enchanced". Thanks, guys. * Supported packages. At the time, the Debian package repository was something like 12,000 packages, while Redhat's was around 3,000. This meant that for any production system, you inevitably had to either compile and install lots of software by hand, or you had to rely upon the community (e.g. http://dag.wieers.com/rpm/ http://dag.wieers.com/rpm/) for pre-compiled packages, but now you've just thrown away the consistency and quality level which comes from e.g. Debian's Policy Manual, and you've introduced a rather gaping security concern into a "production" system. Wonderful. That's all I can recall off the top of my head, but the gist here is that there are a ton of tiny little bad decisions which make Redhat suck, and there's simply no good reason for it. Its just a pile of annoyance. Unfortunately, Redhat has somehow positioned themselves as the "enterprise" linux, so PHB's often make the technical decision to go with Redhat, completely ignorant of its technical deficiencies, dooming their employees to suffer the consequences. Perhaps I'm jaded, but when someone tells me they run Redhat, I immediately assume they made that decision from a position of inexperience, and they simply don't know any better.
- brian_cloutier 14y agoI don't know enough about MySQL vs Postgres or RedHat vs Ubuntu to make a point with them, but sometimes it's not about being cool. Apache is a webserver from 1995. It uses a process (sometimes a thread) per request, a architectural decision which made it nearly fundamentally incapable of solving the C10K problem. Only back in January was the Event MPM added (and it's still experimental), allowing you to have many Keep-Alive connections open at once without degrading performance. Nginx was started in 2004, and is event-based allowing for much higher concurrency. (Yes, I'm hand waving.) PHP is among the worst languages most sane programmers have ever used. The referenced article, "A Fractal of Bad Design" is a pretty good starting point if you want more details on why it sucks. PHP stands for letting amateurs code effectively. Python is designed with an emphasis on readability, and manages to have a rational type system and a fairly regular standard library. Apache vs Nginx is about learning from the mistakes of your ancestors. Apache was designed with the 90s in mind, and our technology has moved on to the point where the decisions made in its architecture simply don't work anymore. PHP vs Python is about being a rational, non-masochistic, human being. To say what is cool "has nothing to do with any objective qualities of the [technologies involved]" is to know nothing about programming as a business.
- brlewis 14y agoPHP stands for letting amateurs code effectively. I hear this a lot. I think people assume that because lots of amateurs use PHP, it must be helping them be effective. This is not a safe assumption. A shoe does not help amateurs drive nails effectively, no matter how many amateurs you see using one. For a better of idea of how amateurs interact with PHP, see http://stackoverflow.com/questions/tagged/php http://stackoverflow.com/questions/tagged/php
- maratd 14y agoYou wrote a well thought out response. I owe you a response in kind. People have a tendency to overrate their rational capacity to reason out a viable decision. While you listed a few solid critiques, the situation is infinitely more complex. And by infinitely, I do mean exactly that. As in, beyond your capacity to reason it out. In the end, the only right decision is a decision which withstands the test of time. Both Apache and PHP have done that and continue to do so. Apache holds 65.5% of the market [1]. PHP holds 77.9% of the market [2]. Those solutions are working, right now, for all of those people. That's reality, not grand "rational, non-masochistic" theories. [1] http://w3techs.com/technologies/details/ws-apache/all/all http://w3techs.com/technologies/details/ws-apache/all/all [2] http://w3techs.com/technologies/details/pl-php/all/all http://w3techs.com/technologies/details/pl-php/all/all Now that we're finished with that, I'm going to enjoy myself. > a architectural decision which made it nearly fundamentally incapable of solving the C10K problem. C10K is not a problem and never was. The limiting factor in the overwhelming majority of deployments is the pipe. Apache can saturate the pipe just as well as NGINX. You will saturate the pipe long before you reach 10K connections. Which is why people continue to use Apache. Being technologically superior is pointless when there are no real-world benefits to that technological superiority. On top of that, Apache's thread model provides it with greater stability. If a worker thread crashes for whatever reason, another will simply spin up. If your NGINX process dies, you'll need to wait until your monitoring solution brings it back up. Which could be a long time. > PHP is among the worst languages most sane programmers have ever used. Worse than COBOL? Yes, yes, a fractal of bad design! Except that article was written by somebody who doesn't have much experience in PHP and most of those complaints don't apply to the current stable version. The rest are easily avoided with sane design. > Python is designed with an emphasis on readability Was that humor? Python shoves its version of readability down your throat and laughs as you choke on it. Not all of us get off on syntactically significant white-space. In fact, most of us don't. Which explains why Python is so unpopular. But I get, I get it. It's cool.
- geon 14y agoIt isn't as much broken, as it is just a bit annoying. Just a bit. Not enough to make it really bad, but enough to irritate you.
- adventureful 14y agoAll languages are annoying if you go by the griping, the more popular a language is the more amplified the griping. It scales out of actual proportion to the flaws, and instead scales based on the popularity. Then throw in the wide spread use, the trendy nature of people, and you have a recipe for endless bashing. The better PHP serves the bottom 95% of developers, the more the top 5% will hate on it.
- brlewis 14y agoFollow the "deeply flawed" link in the article to see lots of bullet points of precise criticisms. The target of the link is http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...
- ijoyce 14y agoPHP "runs half the Internet quite well"? Source?
- maratd 14y agoCommon sense. Calculate how much traffic Wikipedia + Facebook + Wordpress + All The Rest generate. Calculate in the fact that most services talk to other services and more importantly, talk to Facebook. Click on a link? I promise, at some point, PHP is involved.
- ijoyce 14y agoWhen you actually have a real source or numbers, let me know.
- adventureful 14y agoApparently it's closer to 78% http://w3techs.com/technologies/details/pl-php/all/all http://w3techs.com/technologies/details/pl-php/all/all No matter how you try to hide from it, it's blatantly clear that PHP runs at least half the entire Web. What else exactly did you think was? Surely you didn't think Python was running half the web. Obviously Ruby isn't. So what does that leave? Coldfusion? C?
- andrewflnr 14y ago> What else exactly did you think was? Well, in principle, there's no reason any one language has to run half the web by itself. And there are also static pages.
- adventureful 14y agoYou don't agree with the notion that many tech products like web languages (or browsers, operating systems / mobile platforms, or whatever) tend to trend heavily toward a single dominant product (either due to one simply being better, and or a benefit derived from scale of use such as plugins or knowledge availability etc etc)?
- phillmv 14y ago>And yet the gap between tangible proof of that being the case in real world use and the gossip of it supposedly being true, couldn't be wider. Just because something is shitty to use doesn't mean you can't do productive work in it. We're all just poking Turing machines here. Let's not even talk about the enormous weight of sunk cost fallacies.
- DanielRibeiro 14y agoThat is not an unforseen phenomena at all[1]: Once you have something that grows faster than education grows, you’re always going to get a pop culture -Alan Kay [1] http://queue.acm.org/detail.cfm?id=1039523 http://queue.acm.org/detail.cfm?id=1039523
- Legion 14y ago> The only thing actually wrong with PHP, is that it's popular but not cool. No, what's "wrong" with PHP is that other things that are better have come along since. That's not a fault of PHP, that's the nature of language evolution. > It runs half the Internet quite well COBOL runs tons of mission critical business services quite well. It doesn't mean that nobody's improved on COBOL or that you should use it for a new project today.
- crazygringo 14y ago> No, what's "wrong" with PHP is that other things that are better have come along since. The problem is, no, nothing else has. Node.js is awesome and fun, but far harder to set up for basic webpage serving. Python is awesome, but also has a huge learning curve to learn how to serve basic webpages with. And... I can't think of anything else. Perl? ASP? Java is a huge pain to set up and maintain. What other language out there is better than PHP for getting simple webpages up and running quickly? I wish there were one, but when you consider practical aspects instead of just theoretical ones, there really isn't. Sadly.
- Legion 14y ago> The problem is, no, nothing else has. Myself and an army of other ex-PHP developers disagree. > What other language out there is better than PHP for getting simple webpages up and running quickly? This discussion is not just about "getting simple webpages up and running quickly". In fact, it's pretty clear people are talking about developing web applications, and not slapping together a quick and dirty page or two. If you want to have a discussion about what language is best for inexperienced people to whip up a simple site without having to bother learning much, that's fine, but that's not this discussion. At the very least, that's certainly not what Marco was talking about, nor Jeff in the blog post Marco was responding to.
- crazygringo 14y agoNo, it's exactly the point Marco was making: > But when I wanted to write Second Crack, I went right back — it was a quick little project that I only wanted to spend a couple of days on, so it didn’t justify the overhead of learning a new language. Whether it's webpages or web apps, nothing else is better than PHP for getting something small up and running quickly. That's the whole point of why Marco feels "addicted". I really wish there were something better in this context, but there isn't. (And what do you mean, "ex-PHP developer"?? I've never heard someone call themselves an "ex-C" developer or an "ex-Java" developer. You make PHP sound like a cult or religion, instead of just a popular programming tool.)