Ask Acquia: Should Drupal Developers Learn Composer?

Q. I’m new to Drupal and want to know if I need to learn Composer. Is it worth the time investment to learn?

A. The Drupal Association thinks Composer is a solid choice and one that complements the functionality built into their product. In fact, they’ve found Composer to be so useful that they’ve included it in the main distribution of Drupal 8. The level of convenience it provides as a dependency manager for Drupal projects is more than enough to make learning Composer a worthwhile time investment.

Q. What is it about Composer that makes it a good match for my project?

A. Composer allows you to delegate the responsibility of managing dependencies for every third party PHP library you wish to add to your project. By automating the process of installing and updating dependencies and autoloading requirements for external libraries with Composer, you can speed up your development process and enjoy a more efficient Drupal experience. In her post Why I Love Composer, a PHP Dependency Management Tool, Acquia software engineer Charu Agarwal highlights the conveniences that have her and countless other Drupal users raving about Composer.

Q. Does Composer support full backward compatibility with earlier versions of Drupal that I might need to use that aren’t yet present in Drupal 8?

A. Yes. Many developers still rely on the full scope of functionality that is present in Drupal 7, but that have not yet been incorporated into Drupal 8. This is a common situation for web developers and rest assured, if you are working on a project better suited for Drupal 7, Composer is your tool.

Q. What about tomorrow? Can I expect that Composer will be a skill that has long-lasting value?

A. Working with Composer you have the assurance of future proofing your projects when updates are released for third party packages you’ve incorporated. What’s more, Composer has proven to be an ideal tool for building and supporting the Drupal community. As Acquia's Manager of Content Service Engineering Chris Pliakas states in Using Composer Manager to get off the Island Now, Drupal developers have much to gain from platform-agnostic code. By including Composer in Drupal 8, the Drupal Association encourages Drupal users to take advantage of third party innovations made available by the wider open source development community - freeing them to contribute even more solutions of their own.

Q. I’m sold - but where can I get started with learning Composer?

A. There are many excellent web resources that will have you well on your way to Composer mastery. We recommend Easy Package Management With Composerand Dependency Management In PHP Using Composer, two step-by-step guides that will help any beginner make the most of the Composer tool - and of course, the Composer documentation is available for all those who wish to dig deeper.