Is PHP Truly A Bad Language To Write In?

Despite it being 2012 and the PHP wars having been waged for years now, many people still continue to rail against PHP as a programming language. The complaints about it are numerous, and many of them are warranted to some extent: non-standard function names, exceptions to operator usage, and non-standard inheritance of ideas from other languages are just a few of the legitimate complaints that come out of the anti-PHP camp. Many of them, however, curiously seem to center around one core complaint: that it leads programmers to write “bad code”, either because of the reasons listed above or because of others.

The complaint is, on the surface, quite an attractive one: PHP’s perceived failings are leading to programmers who use it writing bad code precisely because it’s not giving them the structure or regularity needed to write good code. If anything, however, the opposite could be said to be true: programmers are writing good code in PHP despite PHP’s perceived failings. Large websites like Facebook are written in PHP, and they work both without bugs and quickly to boot. Likewise, WordPress and Joomla are both great examples of solid, well-written code in PHP. The language, then, seems to have no bearing on how programmers write code. The burden of good code writing lies, as it always has, on the programmer.

But what about the other problems, such as the ones listed above? Those still exist, whether programmers are writing good code or not, and ostensibly they should be preventing programmers from writing the best code they could. Are they?

The answer might surprise you. The answer is… it doesn’t matter. Not a whole lot, at least.

How could it not matter? Well, it’s simple- being the best-designed language was never what PHP was meant to be about. PHP was meant to be a programming language for non-programmers that was easy to pick up and use for simple projects. In that regard, it’s succeeded wildly. PHP is being used in websites from small to large, from the aforementioned Facebook to little custom blogs all around the web. PHP’s appeal lies there, and it’s exploded to such an extent that it’s ubiquitous. And that very same ubiquity means there’s an impressively large support network of third-party modules, help forums, and more for any PHP programmer looking to get their feet wet and having trouble getting their PHP scripts to run.

Some might say that doesn’t matter, and that we shouldn’t be using a language with problems in the first place. Maybe that’s true- but it’s working, and it’s working well. PHP is continually being improved, and it seems as though the developers are accepting criticism and working to help PHP become better as a result. Meanwhile, the large support community means that breaking into PHP is getting easier and easier, with more documentation and more tutorials popping up every day.

Maybe Python is a better language. Maybe Rails is a better language. That’s not exactly the issue here, however: the fact of the matter is that even if PHP isn’t the better language, it’s a good language for the job because it works while also already having a great support community around it. It’s a good language because it’s easy to break into. In short, it’s a good language because it’s for non-programmers who work with the Web- precisely the kind of web programmer that’s driving website creation.

Is PHP a bad language to write in? For some, perhaps. But for me and millions of others, it’s a great language that does what we need it to do with a large community that offers us features and support we never dreamed possible, and for that alone it’s most definitely a language worth writing in!

Help us spread the word!

If you liked this article, consider enrolling in one of these related courses:

PHP is cheap and readily available too – you can’t beat the hosting options. It’s almost the commodity language of the web for server side processing. There are some things I hate about PHP, yet I use it for some projects because the level of entry is so low. Like any language, PHP is a tool, and when you need a quick, easy, cheap tool, PHP is great. If you don’t like it, don’t use it!

What I liked about this training was the professionalism of the course layout and Andre was full of knowledge. Andre took the time to answer all of my questions and made sure I was understanding everything we covered.

- Melissa

Very knowledgable, motivated, and responsive instructor

- Intel Corporation

Instructor was extremely knowledgeable about the topic. He doesn't just teach it, he uses it. That makes all the difference.

- Deborah, City of Arlington

Great instructor, down to earth and very knowledgeable. Taught in a manner that was easy to pick up on. Provided a ton of great code examples that I will always be able to look back to.

- Joe

Boris, you were just fantastic at delivering this course to us! Hope Italy treated you as well in return!

Trainer was extremely knowledgeable. I really appreciate as trainer helped me understand avro files and how to load them which was one of my expectations out of this course.

- ankush, EMC

Guy is a knowledgeable instructor and skillful presenter. He made this course really come together with exercises and practical project. I hope he teaches other courses!!!

- Andrew, Kyocera

Instructor very knowledgeable and amicable. Class materials well suited to stated goal.

- Preston, Intel

I was looking for an Android bootcamp that solidified some of the basics that I already knew and progressed quickly to more advanced topics. This course definitely did that. Overall, I am very happy and I have a large example set to draw from to continue to build my skills. The lab was very practical and robust. Although it was difficult to complete, I managed to get most of it finished and the example for the lab that was provided is an excellent example as well. Also, the instructor was well-spoken and easy to listen to. This is a huge plus.

- David, Gateway Church

Instructor was knowledgeable, systematic and responsive to questions. I have enjoyed the course and have learned a lot about Hadoop. GoToMeeting is an effective medium for presentations and was used very well for communication and resolving problems.

- Lubomir, EMC

This course was excellent! Guy Cole was able to create a great learning environment. He is technical, eloquent, and funny all at the same time. I'd take this course again any time!

- Regina, IBM

Thanks I learned a lot about Hadoop

- Scott, 614-797-5550

I learned a great deal in just a days' Networking Fundamentals Course. Boris, you made my day...

- Rob, Microsoft Corporation

Guy Cole is both an expert Android instructor and a great entertainer. I thoroughly enjoyed this course!

Excellent instructor. Patient and diligent - methodically going over the material until the students have a full grasp on it.

- Derek, NSi

I liked the interactive approach the Guy used during chapter demos and sample app. We all shared our products and learned from each others' blunders. ;-)

- Derek, Verizon

Our team was able to obtain training with only our company team members so that we were able to focus on our specific needs. Thank you.

- Jeff, Marriott Ownership Resorts

Good training material and lots of labs and samples relevent to the course. The instructor spoke very clearly and at a pace that was comfortable.

- Douglas

Great presentation of material and engagement of the class. Learned a lot about services that I have been aligned with for years and got a better and deeper understanding of the content and data behind these transactions.

- Greg, Intel Corporation

Damodar was very kind and patient to keep everyone in sync, if they behind with the labs. Thank you, Damodar!

Guy is a great "guy", and did an excellent job presenting the material and ensuring people "got" it. I looked at bootcamps provided by a number of organizations, and this one was the most thorough, and had the least fluff. I don't think I've ever been as pleased with a course.

The instructor was very knowledgeable, also in the iOS area, what enabled me to get answers about platform differences and similarities.

- Adam, Roche

Just wanted to say THANK YOU SO MUCH for the classes this week! You did a great job and it was very informative! I've been an Oracle developer for almost 20 years now and with my busy work could never find time to get my hands on one of these new technologies. It was an eye opener.

- Dmitry, EMC

Good introduction to Android development with lots of practical examples. Instructor is knowledgeable and jovial.

- Kyocera

Serge, Boris, thank you very much. Very good class!

- EMC

Great Pace, Great Faculty, Great Topic

- Ashish, Meltwater Group

A lot of great examples! The instructor is an Android expert and skillful presenter.

- Krystian, Roche Polska

Instructor was very knowledgeable, helpful, and clear.

- Franklin, Time Warner Inc.

Serge was willing and able to jump off the scheduled presentation and answer specific questions relevant to our organization, which really helped answer some important questions we had.

- Bill, 4Info

Examples were easy to understand and practical. Instructor was candid about challenges in development.

- Robert

The instructor was extremely knowledgeable and made it a great learning enviroment.

- Paul, American Thermal Instruments

The Android App Development class was very effective for me. In just two days, I learned enough material to get me started on my own. Instructor and facility were both top notch!

- Shekhar, MIPS Technologies

Instructor knew all details and explained everything with extreme patience

- Kyocera

Instructor was excellent and made the course interesting.

- Elbert, AO Smith WPC

Goal of training met , in terms of the course objectives set my course managers

- CPT Peter Johnson, U.S.ARMY 53A ISM course

I am an experienced OOP programmer/developer, and I believe that the programming examples were extremely relevant. Mr. Cole put in much effort and ensured that the programming templates were relevant and workeable.

- MAJ Jarrod, Fort Gordon School of Information Technology

Serge has good knowledge and answers all the questions.

- harsh

The Android Application Development course was very well delivered and left me with a wealth of real code I can use at work.

- Vlad, Wells Fargo

Instructor Guy Cole was excellent!

- Intel

This was an intense 3-day course. The great part though is you don't need to remember everything. As long as you complete the class project, you will learn many valuable lessons. I highly recommend this course!

- Pradeep, US Government

I come from a Java background, and Android seems natural for me to pick up. Guy made the transition from Java to Android very easy. He is a very good teacher. I enjoyed this training.

- Leonid

The Apache Trainer was extremely knowledgeable and personable to make the experience worth the time, expense and effort.

- Rick, GTech

Good practical android course. Lots of material but if you pay attention in class you will get your money's worth. Instructor knows his stuff.

- Gene, Verizon

I really liked the exercises where we were asked to do some coding and assignments. Also the last day hands on lab was really good and enjoyed it throughly!

- Intel

I enjoyed the exposure to Eclipse and exploring interactions within the Android environment.

- Hollis, TCI

The instructor is very patient to explain, I think that is great. I liked the course, very good!

- Alex, LogicStudio

I learned alot more in 3 days and could do alot more than i thought possible.

- Joe, Mattel

This course could easily have taken longer than two days, but Boris did an awesome job breaking it down into a shorter course. He explains and demonstrates extremely well!