Tuesday, March 17, 2015

Defending PHP

Yesterday, the developers of the ownCloud project posted a great blog entry explaining why ownCloud chooses to use PHP instead of one of the 'sexier' languages like Ruby on Rails or Node. Overall, I agree with their defense. There's nothing particularly wrong with PHP, despite what we keep being told by the independent developer elite. Sure, PHP has its quirks and it's got it's fair share of 'gotcha' issues that can bite an unfamiliar developer in the ass, but so does every language including the darlings of Internet development.
language like Ruby on Rails or Node. Overall, I agree with their defense. There's nothing particularly

Bad code isn't produced by programming languages. Bad code is produced by bad programmers. I've seen some absolute monstrosities written in Java, C#, Python, and dozens of other languages by developers who never really took the time to learn their tool because they were too busy chasing the hot new language on the block. Likewise, I've seen some amazingly elegant code written in PHP, written by developers who'd taken the time to learn the language and stick with it instead of jumping around when the elite of the development world start saying their language isn't cool anymore. Those developers get a cursory glance (maybe work through a book in a weekend) and never cozy up to the language to learn its curves.

I'm not saying PHP is perfect - it's certainly not. But no language is perfect. If you talk to any serious developer they can likely name a dozen annoyances about whatever their language of choice is. They keep using that language because they've taken the time to learn it. They know what to expect from the language and have embraced it. PHP developers, the good ones anyway, have done the same.

Want to stop writing bad and kludgey PHP code? Stop being a bad programmer. Take time to learn the language, massage its warts, and embrace its differences. You'd be surprised how much more productive you'll be and how much more elegant your code will become.


Michael Kornblum said...

Put a bunch of programmers in the same room and every one will a) have a favorite or b) have a bane to their existence. Personally, I don't have a dog in this fight. Every programming language I've used has its strengths and weakness, and as a front end dev, I use all three. My current stack consists of Sass, Compass and Jekyll. All of them use Ruby as a hard dependency.

My task management tool, Gulp uses Node.js and one of its plugins, PHP2HTML is used to give me templating functionality. All three of the languages play nicely together. Its a shame that their fanboys can't do the same.

Nasreen Basu said...

Really cool post, highly informative and professionally written and I am glad to be a visitor of this perfect blog, thank you for this rare info! , Regards, servicenow training in hyderabad

jatin tyagi said...

I have been reading out a lot of your articles.
I will certainly bookmark your Blog.
Hybris Online Training
Devops Training

John Nash said...

Excellent Blog very imperative good content, this article is useful to beginners and real time Employees. DevOps Online Training

Interview Gig said...

This is an awesome post. Really very informative and creative contents. These concept is a good way to enhance the knowledge. Here You can find some Frequently Asked DevOps Interview Questions and Answers with explanation

Chef Interview Questions and Answers

Docker Interview Questions and Answers

GIT Interview Questions and Answers

Jenkins Interview Questions and Answers

Maven Interview Questions and Answers

Nagios Interview Questions and Answers

Puppet Interview Questions and Answers