From themes to theme frameworks
Back in the 1990's, early in my career, I recall the dream of software components. One day, we would all drag a few components to a design surface, configure some properties, and quickly stitch together new applications. Reuse was our god. Software vendors cranked out shiny new idols with new major version numbers at least once a year. I suppose somewhere in the catacombs of Corporate America, this type of development still continues.
The rise of frameworks
As Open Source software broke the stranglehold software vendors had on application development, one of the biggest trends of the later 2000's has been the emergence of web frameworks.
How many of these frameworks are you using in your web applications?
- Server-side (Rails, .NET, Django, etc.)
- JavaScript (jQuery, Prototype, Moo, dojo, etc.)
- CSS (Blueprint, 960.gs, YUI, etc.)
So what makes a good framework? For me good frameworks:
- Make common tasks easier. Can you do AJAX without jQuery? Of course, and I'm sure you still do from time to time. When jQuery reduces the 80% of AJAX scenarios to one line of code, the benefit is obvious.
- Know when to get out of the way. Good frameworks allow the developer to drop down to more low-level constructs to get work done. Rails provides a number of helpers for creating HTML, but at any time I can craft my own markup. Blueprint provides an out-of-the-box grid layout system, but I'm free to provide my own non-grid layout.
- Provide a great starting point. Good frameworks offer a bundle of value in an opinionated package as if to say 'Come for the free code, stay for the ideas.' For instance, Rails provides a standard directory structure. I can jump into any Rails project and know exactly where things go. Blueprint provides beautiful typography out of the box. With both, I'm getting a return on my installation overhead from the first few minutes of development.
Themable apps - the Scions of web development
Another trend in web development is after-market customization. Some of the most popular open source (and proprietary) projects provide ways to customize application look and feel. Often these changes can be bundled and distributed as an application theme. Marketplaces of premium themes are cropping up all the time as the popularity of WordPress soars.
I've always enjoyed using WordPress. For blogs and sites that need a lightweight CMS, it's hard to beat. I just have never enjoyed theming WordPress. I'm spoiled by the layouts in Rails where you basically layout your site design and the content for each page is dropped into the middle. In WordPress, quite often you open HTML tags in one file (like header.php) and close them in another (like footer.php). Missing a closing DIV tag can be a twenty minute wormhole.
For many projects, someone else's handcrafted markup is just as good as my own as long as I can add to it and style it appropriately. That's the idea behind a growing number of WordPress theme frameworks. Just like the frameworks mentioned earlier, theme frameworks provide the same benefits outlined earlier. They make common tasks easier, they still allow for lower-level development, and they especially in the case of WordPress, they provide a great starting point for your site design.
Another big benefit of going with a theme framework is insulation from change. By using Thematic to build this site, I don't have to worry as much about WordPress changing lower-level functions and breaking my theme because Thematic handles most of the normal logic that goes into a blog site. Instead, my theme uses extension hooks provided by Thematic to add, filter, and opt-out of content. In my next post, we'll walk through creating a simple Thematic theme.
Theme frameworks - not just for blogs
I think theme frameworks make sense for mature projects with a finite set of basic functionality. Blogs surely fit this category, but I am anxious to explore them for projects involving ecommerce, forums, and issue trackers. We're in the early phases of development, but look for some of these theme framework concepts to make into the next release of Spree, the open source Rails ecommerce project.