Web Development

Best Practices Through Frameworks

The increasing number of web frameworks means that design and development best practices are accessible to more people than ever before and are a sign of a maturing industry.

The primary goal of most web development frameworks is to save development time. Since most programming projects share a good deal of redundant code (database connectivity, error handling, form validation and processing, etc.), that type of functionality can quite easily be extracted and put into a framework for reuse later.

Ruby on Rails logo

This drastic time savings was one of the initial draws for the Ruby on Rails framework when it started gaining popularity a few years ago. Because Rails’ was created to be “opinionated” software, the framework makes a lot of choices for you and makes a lot of other decisions really obvious. In other words, Rails makes it easy to do the “right” thing and forces you to do some extra work if you want to go against that. Developers can (and do) debate the merits of injecting opinion into software, but to me it means that I can quickly get exposed to a ton of best practices that will make me a better programmer as a result.

One area of web design that has only recent seen movement toward standardized frameworks is in CSS for web design. It turns out that if you create enough multi-column page layouts using CSS, you end up creating similar foundations for each of the design projects. That’s where new CSS frameworks like Blueprint can save lots of time and help to create a very stable baseline to build upon.

Blueprint CSS

Blueprint’s sweet spot is for designers who need to create grid-based multi-column website layouts. Setting this up on your own correctly takes some time and a lot of knowledge and experience, but Blueprint makes it about as easy as you can hope for it to be. You just download the framework, unzip it into a subdirectory where you keep your site’s CSS, and add an @import statement to your page to start using it.

Using Blueprint as a foundation for your site’s styles mean you’ll not only get it up and running in less time, but you’ll automatically have access to CSS best practices created by designers such as Jeff Croft, Eric Meyer, Nathan Borror, and Christian Metts. This makes the prospect of designing good looking, bulletproof CSS layouts a reality for a lot of web designers.

Zend Framework

Another web development framework that I’ve been keeping my eyes on is the Zend Framework for use with PHP5. Created and hosted by Zend Technologies, the major contributor to the PHP language and creator of many popular PHP related software products, I consider the Zend Framework to be the closest thing there is to an “official” PHP framework.

There has been a flood of new competing PHP development frameworks since Ruby on Rails made its debut: I count 17 major ones listed on a Wikipedia compilation. I think I know why there are so many, though I think most of them are unnecessary and even harmful to the future growth of PHP and the community. I believe the reason is that PHP has a very low barrier to entry: It’s available on pretty much every web host and the basics are very easy to learn. Because of that second one, there’s a very pervasive “build it yourself” mentality in the PHP crowd that causes many developers to write software from scratch instead of adopting and extending an existing project.

Back to problem of having too many PHP frameworks. Some will tell you that having more to choose from is better – these are the same people that build software with page after page of features. Think about it from the perspective of a new developer though. With 17+ web frameworks to pick from, where do you start, and how do you compare? Unfortunately, chances are that you probably won’t. It’s the classic Paradox of Choice: Faced with too many choices, you most likely won’t pick any of them. In this case, you might even go off to create your own web development framework.

So, my hope with the Zend Framework is that it’s able to channel much of the energy currently going into most of the other PHP frameworks. It’s well designed, well tested, has a business friendly open source license, and offers tons of components available for use. I think it’s the obvious framework choice for PHP programmers.