Biilmann Blog

Email works again

It took a while before I noticed it, but apparently info@mathias-biilmann.net has been out of order for quite some time.

 The problems was related to the DNS changes nessesary to host my blog on the Webpop platform, and some server-changes on Dreamhosts site (where my blog used to live). 

I ended up switching to Google Apps, and got a pleasant surprise. Dreamhost offers a special feature, where you can use addresses like info+some_stuff@mathias-biilmann.net when signing up for various services. Then any spam mail that might end up comming your way as a result of the signup, can be easily identified and tagged.

I thought that I would loose that feature with the switch - but suddenly the newsletter from Shoppify showed up at one of these addresses - right in my gmail inbox! I made some tests, and it seems like gmail indeed has the same feature, although it only seems to work for Google Apps, and not for regular gmail accounts...

Biilmann Blog on Webpop

Just recreated my Blog with the Webpop design framework in about 15 minutes.

While there's still quite a bit of work to do before we launch our framework (otherwise we would launch it today!), the platform is already a joy to work with.

It's an entirely different experience than working with something like Dreamweaver or any of the wizards for web-site creation. The Webpop design framework is a tool for web designers with a solid knowledge of css and web standards - not a "one click and you have a generic looking homepage" publisher.

Sharpening the OOP Axe

I spent quite a lot of the last two weeks completely rewriting the internals of a PHP based web-service in use at webpop.com.

The codebase was seemingly coded in an object oriented style taking advantage of the new class system of PHP5, but in reality all connection between objects was based on inheritance, meaning that in practice it was all one humongous class containing all the functions of a procedural program.

I wanted to turn this into a cleanly architectured application with small objects, each doing relatively little, but simply couldn’t find a way to evolve the huge inheritance blob of classes into something like that through small and gentle, gradual refactorings; so I decided more drastic steps was needed, and began a complete rewrite.

One beautiful characteristic of rewrites, is that they present us programmers with pretty much the only case of having a full specification that actually specifies what the customer wants in the end. My spec was an API specification of 26 methods for a REST based web-service, and I had a set of acceptance tests in place to make sure that those 26 method calls worked as expected.

With this foundation in place I carefully started building up a new architecture taking advantage of PHP5’s reworked OOP features, and with no over-abuse of inheritance. During the first week I implemented no more than 3 of the original 26 methods, and yet I confidently told my bass that I expected to finish the rewriting before the end of the second week. I avoided the question of how many of the methods I had gotten done so far, when asked, because I knew the number would be wildly misleading.

This was not due to wild optimism or pure insanity, but because of how OOP works and feels when it’s done right. What I did, while implementing those 3 methods, was extracting the basic generic building blocks of the web-service’s operations. Abraham Lincoln is supposed to have said once “If I had eight hours to chop down a tree, I’d spend six sharpening my axe.” While taking my time, carefully implementing those 3 small method calls, I was sharpening my virtual and object oriented axe.

When the second week started, I had basically all my small building block in place, and 3 days into the week I was done implementing all the remaining 23 methods – it was simply a question of putting existing blocks together in the right way. This is, to me, what OOP is all about: building small reusable blocks with enough flexibility that adding new functionality feels somewhat like a playing with LEGOs.

At the end of the two weeks the rewritten service passed all the acceptance tests, with a line-count around a fourth of the original code-base and with a far more flexible architecture, that has already made me implement several feature enhancements that would have been seriously big pains to add before the rewrite.

Comment Spam

Since my comments started getting severely spammed I finally got around to implementing a simple anti spam meassure.

The comment form now comes with an invisible field not meant to be filled out. We’ll see if the bots falls for that one and happilly enters their pyload into the spam field.

Ferret Search Problems

It seems my webhost installed the Ferret gem recently. This is quite nice, but for now it seems to have created a conflict with my own local install of the Ferret gem and the ActsAsFerret plugin – so search throws an application error at the moment.

Wont have time to fix it before after the weekend. Hopefully search will start working again monday.

Update

Ok – couldn’t help taking a look at it anyway, and search should be working properly again now.