Why make things pluggable?

Just thought I’d share. Larry Garfield (aka Crell aka Drupal’s DB maintainer) left an insightful comment on this blog post:

[…] That’s one of the reasons we maintain a pluggable theme layer, even if it’s not really used [i.e., everybody uses phptemplate even though it’s not the only option - Mike]. It forces us to think about how the theme system will be used and what parts of it really belong where. That’s the example, actually, that Jeff Eaton gave me over dinner one night while I was bemoaning how difficult it was to support PostgreSQL in early versions of DBTNG. :-) Just because no one uses Postgres doesn’t mean we shouldn’t still support it, because forcing ourselves to support it forces architectural decisions that improve the overall system in the first place.

And you know what? He was absolutely right. Now we have full support for 3 databases, a 4th in contrib, and the overall DBTNG [i.e., DB The Next Generation which is the D7 implementation of Drupal’s multi-database abstraction layer - Mike] architecture is much cleaner and better than it would have been otherwise.

Making something pluggable can be an excuse to force yourself to make it right. That you also enable other people to swap it out themselves (with a little or a lot of effort) for their own implementations that do things you never dreamed of is a nice side effect. :-)

This in response to the growing smallcore movement. My ramblings on that are coming soon.