UPDATE: Part 2 now available.
After you’ve been coding PHP for a while, you start to work out what the tools of the trade are, which applications can help you work more effectively, and essentially how to get things done. While developing, your environment is crucial: not having the right tools to do your job can be a serious impediment on productivity. In this new series, I’ll help you bring together the ultimate PHP web development environment.
In part 1 of this series, we’ll start with the usual suspects: software. The software you use can make or break your project; not being able to debug code, for instance, can double the time taken to complete a project. Here I’ll be covering software for Windows users, but many of the suggestions here are relevant for OS X and Linux users as well.
We could have started with the IDE, but your web application doesn’t end at the IDE. In fact, a sufficiently low-featured IDE can help your project if coupled with a decent browser. The web browsers – yes, browsers, not just one browser – you use are arguably the most important part of your arsenal. A sufficiently powerful web browser can make pulling an application interface together extremely fast, while an outdated and inflexible browser can cause endless grief. Remember, you’re a web developer, and your web browser is your window into the world you work in.
Of course, you can’t just work with one browser all the time. Given IE’s dominance, a copy of Internet Explorer 7 and regular rendering tests of your applications on it should be taken for granted. Once you’ve got IE7, take a look at the IE Developer Toolbar too; you might be pleasantly surprised at how much power IE web developers have as well (although nowhere near as much as Firefox).
And finally, given IE8 is going to be highly standards compliant, having a stable standards compliant web browser might be an idea for future-proofing your application. Ironically, the best browser for this is Apple’s Safari. Safari uses the WebKit rendering engine, which is not only far more standards compliant than Firefox, it’s also considerably faster. Under Windows, Safari isn’t a very good idea for standard web browsing given some past security concerns, but checking your applications render fine on Safari is definitely a good idea for future proofing your application.
Okay, I’m putting this out here right now: it doesn’t matter what IDE you use, as long as it has a debugger. This limits your options considerably; for Windows, the best way to get an IDE with a debugger is to get yourself a copy of PHPEdit or PhpEd. A number of other IDEs offer inbuilt debuggers, but none manage the simplicity and ease of use as these two, especially PhpEd. And it just so happens that both PHPEdit and PhpEd have syntax highlighting, code completion, CVS integration and all the usual features you’d expect to get out of an IDE.
It’s worth mentioning Zend‘s Zend Studio and Zend Studio for Eclipse, as these are by far the best editors available for simply coding PHP, especially the original Zend Studio. The code intelligence is second to none, code completion is the most helpful of any IDE I’ve ever seen and the full-on feature set is ideal for any web developer. However, Zend Studio has two strikes against it: first, it uses Java, and second, the debugger is very complicated to setup (I think it needs a seperate product altogether, Zend Studio Server, although after hours of searching I simply could not work this one out). The problem with using Java is that the editor is very slow; in my tests, it started using 250MB of memory after working with some code for an hour, and it also slowed to a crawl. Think three second lags just to open context menus or expand a filesystem tree; five seconds to open a new (1KB!) file and fifteen seconds to switch to the inbuilt web browser. You’ve got work to do.
For a more comprehensive, albeit less detailed, roundup of IDEs, check out this article on IBM’s Developer Works.
To complement your IDE, and for quick code edits and tests, grab a copy of Notepad2 as well, and remember that if your PHP binary is in your system PATH you can test out code interactively just by running php -a through Start > Run (also winkey + R).
That’s all, folks!
That’s all for browsers and editors today; in the next part of this series, I’ll take a look at configuring PHP and various other software and some Linux editors and utilities.