a companion discussion area for blog.codinghorror.com

The PHP Singularity


#161

Interesting article. I’m a PHP Developer and I certainly understand some of the issues with PHP and feel no need to try to defend it.

I’ve had to inherit PHP code that makes me want to pull my hair out and scream - the spectrum of code quality is tremendous. When someone says “I can code PHP” that literally means nothing.

Personally, I’m a big CakePHP user and I can’t settle for anything less. Admittedly, I couldn’t understand CakePHP until I learned MVC through Objective-C and iOS Development. This probably means I’m ready to move into something else more serious for my server side implementations. PHP has certainly not been enough to make me the best I can be.

That said, I’m really against this blind and aggravated PHP bashing. To the character “Vilanye” above - IMO you are the worst kind of coder/developer not because of your code quality but your attitude toward other developers. That kind of tone just alienates peers and does no good to this industry. Calling PHP developer names doesn’t make this problem better, it just makes you look like an ass.

I’m always wiling to personally improve, but when people bring knives to the party, I leave.


#162

@Vilanye

The rest of your comment it typical of ignorant PHP “devs”(is there any other kind?)

Seriously? It doesn’t matter what language you programme in, you’re still a complete and utter arsehole.


#163

Nice about the PHP articles, it is really informative.
http://emailmarketing.comm100.com/email-marketing-ebook/email-unsubscribe.aspx


#164

His analogy is amusing, but I think a more apt analogy would be that PHP is a hammer and phillips screwdriver when most web developers have become accustomed to nailguns and square drive drills. After all, an experienced carpenter can use a normal hammer just fine, but it will take him a bit longer, while a novice is likely going to hit his finger a few times and make a few holes before he gets it right. I almost have to wonder if the person who wrote the original entry was just recently introduced to PHP. Aside from a few bugs introduced in 5.4 nothing in there is news. None of it was news 4 or even 8 years ago. We get it.

Just as it’s easy now to talk about how awful and inconsistent IE6 is, it’s easy to trash talk PHP, because it’s barely changed in 10 years. It’s much harder to remember how much more horrible everything else was at the time it rose to prominence. Remember what else was out there in 2004? ASP had all the quirks of PHP, with a worse language, and a server stack that makes PHP look like a model of security. Java Servlets were slow, and had to be recompiled for every change, which was even slower. Ruby on Rails didn’t even exist yet. ASP.NET was around but it was years away from a serious web development platform. The fact that it is taking this long to depose PHP when it stagnated so many years ago is an impressive testament to how far behind any of the alternatives were.

PHP was also the fastest option around for quite some time. (Or at least, the fastest in widespread use.) It wasn’t until relatively recently that some of the other platforms were able to catch up to it performance wise even without cached compilation. If you have a caching layer like EAccelerator in place I don’t think there’s still anything that can touch it. (Could be wrong here - it’s been a while since I’ve done close tests. These days I avoid PHP whenever possible.) To me, the linked blog’s arguments for having app servers separate from web servers seems to boil down to “My web servers can handle a couple thousand requests per second, but my web app framework can only handle a couple dozen.” To me this is more a criticism of the other web development platforms out there, and another example of why PHP is still around. Obviously most people don’t need that level of performance, but for those who do, it certainly makes a big difference.


#165

All that said, I love the hammer, and I badly want one to hang on my desk…


#166

%s/PHP/VB/g


#167

PHP seemed cool back when I didn’t know how to make websites. It gave me this false sense of confidence that making websites was simple. Then I grew up.

I’d love to use the alternatives but I think Ruby sucks too, I like it when data type rules are enforced at compile time instead of runtime. No matter how you design a website you will have to enforce data type rules somewhere, why not knock it out before the code even runs?

I’d wish Perl was an alternative, but honestly I think it sucks more. It’s a better procedural language but that OOP soup is a nightmare. No thank you.

I’d wish C# was an option, but I don’t want to pay MS that much money. I don’t see the value in locking myself in to their technology. No thank you.

I’d wish C++ was an option. I absolutely love C++, unfortunately it can also be incredibly tedious at times. I would use C++ if there was a modern and well established web library for it, but I’m afraid I’ll be stuck on my own trying reinvent wheels because of missing documentation. Furthermore, there goes any chance of collaboration. Most programmers aren’t sharp enough for C++.

This is why I use Java. I am not a fan of Java and I think it’s libraries suck, and it’s implementation of generics without static typing support is backwards, but it’s modern. Unfortunately, compared to PHP the setup is much much more complex and your hosting options are severely limited.

People use PHP because it’s easy and it gives you the illusion that works just long enough for you to buy it.


#168

I like PHP. It has its quirks, but I’ve not yet used a language that didn’t. The C-like syntax is comfortable and easy to grasp, and I spend less time thinking about my environment and more time working on solutions.

The double-clawed hammer analogy only works when there are regular hammers available. I would contend there are not. There’s hammers without claws, hammers without handles, hammers with axe heads instead of flat heads. Once you reach a certain level of understanding in ANY language, you will have encountered enough quirks and oddities that you’ll hate the damn thing.

I think this is perfectly natural; it doesn’t only happen with programming languages. Ever heard the phrase “familiarity breeds contempt”?


#169

If this was my first time reading a complaint post about a language, I’d be tempted to say “Yeah, it sucks! It’s all PHP’s fault!”

I’m more that the first to admit that PHP has its failings. I’ve even held PHP up for ridicule in my webcomic.

But over the years, I’ve realized: It doesn’t matter! There has never been, nor will there ever be, a language so perfect that none can criticize it. PHP is a cynical language that says, “You’re going to bitch no matter what we do, so who cares? Do you want to build something or do you want to sit around arguing about design for the rest of your life?” Because trust me, if we never designed a language until we had the perfect, crystal-clear consensus about The Perfect Design, we’d still be waiting for our first language.

The most successful languages, like the most successful governments and corporations, seem to fly by the seat of their pants not giving a crap about how to do it right. That says something about us. It says “We need to do something right now, whether it’s right or wrong.”

We’ll still be having these debates centuries from now. But me, I just build. Starting from rocks and sticks, if necessary.


#170

(1) You’ve obviously never tried to program Sharepoint
(2) what about using Mono and Apache ?


#171

The art of writing good PHP is realizing that it is not, in fact, only a two-clawed hammer, it is a toolbox that puts the two-clawed hammer out on top and buries the normal tools way down deep where you only find them by looking for them. And then excludes several tools that everyone will eventually want to use. So what you do is you ignore all the weird, nasty, and funky stuff and focus on what works well and makes sense. And then you begrudgingly pull out the two-clawed hammer when you have to, because the only other hammer is ball-peen and damnit, you need a claw.

Regarding alternatives, there’s a ton of them and some are gaining traction. I’m partial to nodejs for reasons I won’t go into here (there’s plenty to argue about re: javascript since using it wrong has been the default way of operation for over a decade now).


#172

Props for Flask/Django.

I’ve worked with teaching Python as a replacement for PHP to our interns, and the Pip vs Pecl comparison really wins folks over. I’m of the opinion that package management is actually MORE tedious with PHP.


#173

We can use Tomcat and build shared containers with dynamic Groovy/Java 8 code and work on the footprint.
It’s a longshot but It would just work a thousand times better than php.


#174

So mighty websites like “Facebook” “Wikipedia” and “Wordpress” have their roofs upside down ! Then which website is properly constructed ?! This is called Bitching about something which you cannot stand!


#175

After years of doing professional work with PHP I decided to abandon the language from my tool set, and it was a good decision.

Having a widely available alternative sounds too good to be true, considering that many many web hosts don’t give you a real choice, even if they claim to offer Ruby, Perl or Python, and they are very slow adopting new technologies.

Good luck in making an awesome alternative, unless it’s based on the imho even more abominable Microsoft stack.

One word about Rasmus, he may be “breaking the Web”, but I don’t get why people, who dislike PHP, feel the need to insult him.

While I agree on most of the PHP criticism and consider tools like Wordpress awful from a developer perspective, I think they are important as they’ve provided non-tech people a way of publishing on the Web for quite some tome now.

The Web would be just irrelevant, if only software developers were able to do so.


#176

I have never been the biggest fan of php. My favourite language of choice is ocaml, with python and ruby not far behind. But I make my living writing web applications and not having the option to choose which servers those apps will run on usually means that php is the obvious choice. One thing I would like to point out, though, is that with version 5.3 and more recently 5.4, PHP now has a feature set that make it a worthy language to program in. If it had annotations (hint) then I would find it hard to find anything wrong with at all in practical application building. Add the fact that it has a decent market share of good web frameworks, including enterprise, micro and all between, excellent templating engines and suddenly the difficulty in finding fault with the venerable old workhorse increases rapidly.


#177

Ahem, may I reference, Windows command line hacks (http://www.codinghorror.com/blog/2005/07/stupid-command-prompt-tricks.html) and you’re bitching about PHP?

C’mon. Give it a break. I agree PHP is a pain to work with, but it’s no more difficult to work with than Perl.


#178

There are only two kinds of languages: the ones people complain about and the ones nobody uses…


#179

"There has never been, nor will there ever be, a language so perfect that none can criticize it. "

This is true but you miss an important point.

The delta between the flaws in PHP and any reasonable language is not insignificant.

In other words, just because all languages have warts doesn’t mean that they are all equally flawed.

That is something PHP “devs” fail to understand.


#180

“Seriously? It doesn’t matter what language you programme in, you’re still a complete and utter arsehole.”

I know, the truth hurts. You can have my shoulder to cry on if you need it.

If your field of view is PHP or Java, you need to evaluate if you have any clue. Of course, if you had a clue, your field of vision would be much larger.

Self-trained language end-users have no business programming. PHP is written by amateurs for amateurs, therefore if you use PHP you have no business programming.

It is people like you and all the PHP defenders that cause me to support strict professional standards and licensing for all programmers.

Where I live a hair cutter needs to prove proficiency and get a license, but any old idiot(and lots of idiots flock to idiotic languages like PHP) can attempt to write software and infect the world with it. Makes no sense.

Programming is a professional endeavor. Full stop.