Tuesday, August 21, 2012

PHP - It's time to reject the bad

Smoking is bad.

Drunk driving is bad.

Windows Vista is bad.

There are many things we encounter in life that we inherently know are bad. PHP is bad, but despite the myriad of evidences presented over the years of what makes PHP a truly bad language, it, to my biggest dismay, still remains the most used web scripting language in the world.

It's pretty much been established by most programmers that PHP is a bad language and there already are many, many, many places that already discusses what an abomination of this language is. Seriously, if you don't believe me, just google "Why PHP is bad" and "Why PHP is good", I guarantee you that you won't find much results for the latter keyword. If this still didn't convince you, let the numbers do the talking for you. But if you care about what I think on this matter, read on.


Of all the sites and blogs I visited, this analogy I found from fuzzy notepad best represents the PHP nutcase scenario so I'm going to paste the quote here:

 Doesn't that just make you laugh?
I can’t even say what’s wrong with PHP, because— okay. Imagine you have uh, a toolbox. A set of tools. Looks okay, standard stuff in there.
You pull out a screwdriver, and you see it’s one of those weird tri-headed things. Okay, well, that’s not very useful to you, but you guess it comes in handy sometimes.
You pull out the hammer, but to your dismay, it has the claw part on both sides. Still serviceable though, I mean, you can hit nails with the middle of the head holding it sideways.
You pull out the pliers, but they don’t have those serrated surfaces; it’s flat and smooth. That’s less useful, but it still turns bolts well enough, so whatever.
And on you go. Everything in the box is kind of weird and quirky, but maybe not enough to make it completely worthless. And there’s no clear problem with the set as a whole; it still has all the tools.
Now imagine you meet millions of carpenters using this toolbox who tell you “well hey what’s the problem with these tools? They’re all I’ve ever used and they work fine!” And the carpenters show you the houses they’ve built, where every room is a pentagon and the roof is upside-down. And you knock on the front door and it just collapses inwards and they all yell at you for breaking their door.
That’s what’s wrong with PHP.

I for one, strongly believe that PHP is fundamentally broken that all web programmers should scrap the language and go with other languages that are a lot more sensible to work with.

And seriously, if I hear one more retarded comment like "but websites like Facebook is built on PHP, there has to be something good about the language!" herp derp shit, I will put you in a submarine and make you peel onions for six months. Even the developers of Facebook are saying that PHP is a bad language (it was too late to switch the language by the time they realized this).

A hilarious picture seen from http://isphpagoodlanguage.com/,

People are finally catching onto this idea and abandoning this language. I'd say that in approximately five to six years, another language will overtake PHP's place for web programming and maybe in ten years, programming in PHP would be something that is equivalent as programming with BASIC. I don't know, maybe I'm making too much of a stretch in my conjecture.

Why hasn't abandonment begun? For one, programming is like a religion, and frankly, it is so for a good reason. I would rather die than trying to make a religious person stop believing in their god. Same can be said for programmers -  regardless of how illogical programming in a bad language can be, unless if the evidence is 100% clear and is incontrovertible, you can bet your as- I mean your buttocks that people would be reluctant to stop using a language of their choice altogether.

But I need to raise an important point here: once people get in their comfort zone with a language, too many of them I see become reluctant to try out new things. When I started to learn PERL and discovered the awesomeness of it (I don't really mean to advocate PERL here. I'm just using this as an example), I mentioned this to some of my colleagues and I would get responses like "I heard that language is bad because it allows you to write illegible code" or "I've never used PERL but I think it sucks because other people say so". I mean what the fuck? I could whip up a code that nobody would possibly understand in any given language but that is aside from the point here.

Technology changes at an unprecedented rate nowadays. One of the important characteristics I believe when it comes to being a programmer is "how fast and how well can you adapt to new things".

I can't be too harsh here, dropping a language of your choice that was used in mainstream websites is not an easy to do. But when the bad signs are becoming more and more apparent, I'm never hesitant in doing so. And I'd say we're past due.

I also gotta be honest and give PHP some credit. It was a good language of choice about 10 years ago, largely because there weren't any other good alternatives. Well now there are. As websites are becoming more and more complex, using a good scripted language or a compiled is definitely the only logical choice to make.

Even the most zealous, fanatics of PHP believer are now catching onto the idea. If you are using PHP and you aren't really aware of the power of alternative choices, well then perhaps it's time for you to join the party.


No comments:

Post a Comment