redbook.me has recently undergone a fairly significant overhaul of its underlying codebase. When I built redbook initially a few years ago it was flat, very flat. The backend of redbook.me is written in PHP and I’m ashamed to say that while it worked fine, I had a PHP for every page and some core functions in a common file. Code duplication everywhere and not a class in sight!
When I decided to go back and improve redbook.me, the first thing I thought to do was to rewrite everything from scratch. And I tried. But the task proved to be just a little bit too big. So I took the iterative approach - slowly improving the existing code with a direction towards better practice.
The situation has improved significantly over the last few months and recently it has taken a substantial jump. redbook.me now uses lots of the new shiny features of PHP 5.3 including, namespaces, PHP5 classes, etc. In addition, I’ve restructured the code so that it uses something close to a Model, View, Controller (MVC) object oriented design.
When making the improvements I drew inspiration from projects such as Ruby on Rails and Symfony2. Actually, I’m using some of the Symfony2 components in redbook.me to handle HTTP requests and sessions. No sense reinventing the wheel!
I feel like I’ve discovered all these benefits of object oriented design a bit late but hey, better late than never! The effect these improvements has had on my enthusiasm for improving the product is pretty strong. Indeed, I’ve even decided to start commercialising! Check out redbook.me.