Sam says you should read this
This blog was created with the BlogFile software, written by Samuel Levy.

You can find Sam on Google + and LinkedIn.
 

The PHP problem (or "why PHP experience isn't always a positive")

PHP is a popular programming language. Much of the web is running on it, and many Open Source projects use it. This is because PHP is a very easy language to use. Everything about the language is designed to make life easier for the developer. It lets you make quick applications without having to sweat about syntax, or compiler errors. For an inexperienced developer, or a small project, this is great. If you have to maintain the code, however, this can cause problems.

PHP doesn't actively promote sloppy code, but it is very forgiving about it. In the four or five years since I started programming in PHP, I've seen a lot of code. Some of it was good, a bit was great, but the vast majority was just plain messy. People threw code together, because the project had a small budget, or didn't interest them, or they didn't know any better. I have seen PHP code that was written in a very procedural, C style. I've seen PHP code that was so abstracted through objects that you had to follow a paper trail through six files to change a single word on a page (this is not an exaggeration). The thing is, they both worked. They were supposedly completely different paradigms, but PHP handled them both like a champ. And then I saw PHP code which had both of these styles running, not only side by side, but completely integrated.

PHP is very flexible, but this makes it unpredictable. With many languages, there are rules and structure that makes it easy to figure out what is going on. PHP doesn't have a particular defined structure, which that makes it harder to modify other people's code. Just having experience in the language doesn't mean that you can always work with it. Add to this the modular nature of PHP, and the vast changes between versions, and you may not be able to figure out what a piece of software does at all.

Due to this flexibility, developers who start with PHP may have troubles when they move to a different, more developed language. Like Visual Basic before it, people who learn to program with PHP may have to spend weeks, months, or even years un-learning bad habits.

When it comes down to it, PHP is a powerful language. Modules add functionality which can rival almost any other developed language. Ease of use means that initial development time can be greatly reduced. It's easy to deploy, and easier still to find somewhere to do so. Because of these reasons, people have flocked to it as a first language, and the power of PHP has kept more advanced developers using it. It won't win any beauty contests, but it does the job.

PHP does tend to teach sloppy coding, not deliberately, but because it allows it. This creates a stigma around the language where PHP developers are treated with little respect. The underlying problem here isn't PHP itself; the same thing has happened time and time again with almost all web-based technologies. This is changing as the web grows and evolves, but the thought pattern still exists. The web is no longer simple pages, but is now home to many complex software systems, and in many places is starting to replace desktop applications.

Experience in other languages can help dispel the stigma, and can help a fledgeling PHP programmer to break the mould, but until PHP's structure matures further (PHP 6 is looking promising), it will have to bear scorn for being "just a scripting language". Amazing things are being done with it right now, and it is really pulling it's weight in the web world. It shouldn't be shrugged off as a hobby language, but should be embraced for it's power, ease of use, and speed of development.

Comments have been locked for this post.