Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

Phpstorm & Drupal presentation from DrupalCamp NW 2013

Parent Feed: 
teaser image for blog post

What's the point in using an IDE, especially a paid one, for PHP development when there are so many simpler, free tools?

In November 2013 I was lucky enough to be offered the chance to present a session at DrupalCamp NW on why it's time for Drupal developers to be using a proper IDE. The session used JetBrains PhpStorm as an example, but presented the case including other popular IDEs like Eclipse and NetBeans as well.

Drupal is getting more and more complicated, and, as developers, we should feel obliged to create code that looks good, does what it says on the tin, and works every time. An IDE provides modern functionality like syntax highlighting, step debugging, and other niceties, such as the ability to look up function documentation then and there in the IDE without needing to browse to a website. It also provides a whole bunch of error checking, like making sure you return the correct values from functions, or using static methods correctly, with zero effort required.

Coding standards is a big thing. Nobody's required to do it at the moment, but in the past, Drupal's contrib has filled up with poorly formatted code, or just code that is difficult to read or written in an alien style. In the past, we had to write our code, then run a command to review it before making a commit, which was a pain. With modern IDEs, we can be shown coding standards errors as we type them, so not only can we make fewer mistakes when we commit, but we learn instantly what kind of formatting to avoid and what kind works well.

As we move towards a more object-oriented approach in Drupal 8, away from procedural code, hopefully we will migrate to good object-oriented patterns. This often means jumping around in code more and more, since we will be writing one object per file, and sometimes method implementations are inherited from higher up in the hierarchy. An IDE makes the task a lot simpler, and you're able to see quickly and easily where an object gets its stuff from, and whether you have overridden or implemented methods correctly.

Although a PhpStorm licence comes at a yearly cost, I feel that the time saved more than makes up for the fee. Many people in the Drupal community are Apple users (or fans) and think nothing of laying down over £800 for a new Macbook! A PC would do, but many feel that the convenience and experience of using a Mac is a better way, and the same applies to PhpStorm!

In short, as a Drupal community, we already have a wealth of contributed modules that do a whole host of useful things, but now we should be focusing more on code quality and documentation, to involve more people more easily, and make sure things like updating modules and providing extra functionality are a breeze, not a chore riddled with semantic or conceptual problems. Nobody's forcing you to use an IDE, but if it'll help you write better code and make a more positive contribution to Drupal, at no (or little) extra cost, maybe it's time to make the switch.

Here is the video of the session:

And the presentation slides:
Phpstorm & Drupal presentation from DrupalCamp NW 2013

Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web