Skip to main content
 

Things you should know as a PHP developer

PHP gets a lot of flak, deservedly. It's not necessarily always been the world's most elegant language, and because it's incredibly permissive, it makes it much easier to write code atrocities than many others. It's not the coolest language out there, but if you're picking languages for your project based on how cool they are, you've got bigger problems.

It's also among the most popular programming languages on the planet, is compatible with virtually every web server out there, and has an extremely wide body of support. There are many very good reasons for picking PHP as your engine of choice. Consider why WordPress runs 10% of the web and 22% of the top 10 million sites.

I find myself in the position of hiring PHP developers on a regular basis. Here's some things to consider if you're looking for work:

PHP is not (just) a bash scripting language
A lot of people who hack in PHP do so as a series of bash scripts. That's fine, if it suits your purpose, but it's also capable of running fully-fledged applications. WordPress runs on PHP. Drupal runs on PHP. Facebook, at least to some extent, runs on PHP. You're going to need to understand how application development works, and how that applies to development in PHP. Which brings me to:

PHP is not what it was
A lot of people's understanding of PHP is rooted in PHP 4, which was a largely-procedural language. Even up through PHP 5.2, the object-orientated functionality wasn't strong, which is why frameworks like WordPress can sometimes seem like an endless sea of isolated functions. It's these versions of PHP that are infamous for having functions with seemingly-random parameter orders, or error messages that would unexpectedly scream at you in Hebrew. The modern PHP is an object-orientated language that is fast and up-to-date. Namespaces, solid OO, reflection, anonymous functions, excellent testing and dependency management, with things like native JSON support at a deep level: all at your disposal. You need to understand them.

PHP is rapidly evolving
The single best resource for keeping on top of best practices is PHP: The Right Way, which is open source and available in 18 languages. As it takes care to state at the beginning, there is no canonical way to use PHP - but the methodologies it lays out offer a robust standard that will mean your code runs well, is easy to read, is safe, and is compatible with the widest possible body of work. I expect all the PHP developers I work with to at least understand what's contained in the book.

It's not enough to write code
This isn't about PHP, but pertains to all developers in a startup environment. You've got to communicate, both with your team-members, and with your users. I mean that in two ways: the first is by actually talking to both sets of people on a regular basis. Both feedback loops are incredibly important, and you need to find a way to get solid feedback from users and potential users in particular that's right for your startup. But the second meaning is that your product - the thing you're building - is a form of communication in itself. You are communicating with people by making something for them. It's never enough to simply satisfy a list of feature requirements: every developer needs to have a solid understanding of why they're building those features, for whom, and how they're going to know if they've built something that solves the problem for those people. Elegant solutions are useless unless they ship.

Haters gonna hate
I'm certain I'll get replies to this post mocking me for advocating PHP. That's fine. What you should be measured by is the end-result: the product you've made for real people. I don't care if you're using .NET or Perl or FORTRAN: create something that is useful, can be sustainably maintained, and solves real problems for real people. In a lot of cases, PHP is the best fit for getting you there.

· Posts · Share this post