PHP is not a Swiss Army Knife, quit calling it that.
I’ve heard a lot of people compare PHP to a Swiss Army Knife. You know the ones, 5 blades, a corkscrew, a saw…and the obligatory toothpick that you will lose so you might as well take it out now and just throw it away. Why anyone would consider PHP to be like this is beyond me.
A Swiss Army Knife undergoes a lot of design work before it is released. It is well designed, it is engineered, it is purposeful.
A Swiss Army Knife is polished and refined. You never see a brand new Swiss Army Knife with metal burrs on the blade, or scratches on the casing. It’s beautifully chromed and polished.
A Swiss Army Knife is a bit bulky and kind of a pain to tote around just in case you need to saw something less than 2 inches thick. The larger ones are pointless. Who is going to carry that and even if you do, you can’t hold it comfortably to use it.
No, PHP is none of those things, it is not purposefully designed, it is not polished, and it is not bulky.
PHP is a screwdriver. Not a Wal-Mart $2 screwdriver, PHP is the Craftsman screwdriver your grandfather has had in his toolbox for 10 years and will one day be yours.
PHP is ugly. Yes, I said it, and I don’t care. Sometimes PHP’s syntax can be an ugly beast. You don’t like that, go work with a language that is designed for beauty.
PHP is lean…or at least as lean as you want it to be. Have you ever compiled PHP from scratch? If not, I urge you to try at least once. The options you can turn on and off are amazing. You can tailor PHP to your exact needs and leave out everything else.
PHP is useful. Like that old screwdriver, you can drive screws with it, pry open paint cans, clean out gunk from under your fingernails, or flip it around and beat down a stray nail with the handle. When you are done, you just toss it back in the toolbox until the next time you need to get something done. PHP gets out of your way and lets you get stuff done.
Yes, you can do stupid things with PHP, you can with any language. Like pointing a screwdriver at your eye, it’s easy to do serious damage. That’s not PHP’s fault though, that’s your fault, quit blaming the language.
PHP is a more widely used language on the web for one very good reason, when you need to get something done, it’s always there in your toolbox, ready for you to take out, abuse in new ways and then put away. You can carry around a Swiss Army Knife if you want and hope the situation you are in can be solved by one of the 5 blades…or the corkscrew, or you can just pick up a screwdriver and get the job done.
Photo Credit: tnz
Released under CC BY-ND-2.0
Leave a comment
Use the form below to leave a comment:
Responses and Pingbacks
October 11th, 2011 at 2:28 pm
Beautiful. End of discussion.
October 11th, 2011 at 2:57 pm
In the last few years the description that I’ve been using is that PHP is glue. I think this description fits, the web is mostly about gluing together various components to provide something useful. Though it isn’t always pretty, gluing things together is something that PHP does very well.
October 13th, 2011 at 12:11 am
Fantastic post. Love it.
October 13th, 2011 at 1:41 pm
Here’s a interesting quote from a recent article here on phparch, Building the Backside β Part 1 :
“In case you did not know this, I love PHP.
It is the Swiss Army Knife of development languages”
October 13th, 2011 at 9:14 pm
“Why PHP
wasis aGhettoScrewdriver”http://codefury.net/2011/04/why-php-was-a-ghetto/
October 14th, 2011 at 2:57 pm
This is just a horrible post.
You are applying attributes of a non-object to a real object.
You also contradict yourself a lot, as mentioned above.
October 14th, 2011 at 8:12 pm
@ad2joe
π caught me. Even I call it that from time to time.
@Chris
Sorry you didn’t like it but other than the fact that I called PHP a Swiss Army Knife in a previous post, I don’t see where I contradict myself “a lot”. And honestly, you are over-thinking the analogy. π
Thank you both for the comment!
=C=
October 14th, 2011 at 8:26 pm
> you can drive screws with it, pry open pain cans,
I’m not sure if it’s a typo, but I love this line. The analogy of opening a can of pain many times describes how I feel when I throw the welding mask on and get under the hood of a complex application regardless of language.
Great post. I agree that PHP is what you make of it. We use it for everything mostly because it is so easy to get other developers up to speed with it. It doesn’t matter what their programming background is. Most of them can pick up PHP in less than a week.
October 14th, 2011 at 9:49 pm
@michael,
Yeah, I’m gonna blame that one on my Editor. π I’ve corrected it to “paint” but you know, you are right, “pain” is fitting. π
Thanks for taking the time to comment.
=C=
October 15th, 2011 at 9:44 pm
Another typo? “A Swiss Army Knife is a bit bulky and kind of a paint to tote around…”
October 17th, 2011 at 1:34 pm
@mark
Thanks for pointing that out. Obviously I have a problem with the words paint and pain. π They have been corrected and our editor has actually reviewed the article now and given it a thumbs up. (Something I probably should have had her do BEFORE I published it) π
Thanks for taking the time to leave a comment!
=C=
October 21st, 2011 at 6:24 am
[…] in Sachen dynamisch typisierten Programmiersprachen voll auf PHP, aber wie der Titel schon sagt: Es ist kein Allheilmittel. Jede Sprache hat seinen Einsatzzweck und mit PHP kann man halt unheimlich viel machen, nur leider […]
May 26th, 2012 at 3:38 am
wow nicely written praise to php, honestly when i was willing to start programming i found that php is my choice everything to need to program is found in there it depends on you the person behind the code how you build logic that matters it is the screw driver that got me by a lot in my professional life