CodeSOD: Customer Needs

Code changes over time. As business requirements change, you need to update your code to reflect that, and the best way to do that is to structure your code and plan for changes before you even know what changes you need to make. Making your code flexible and changeable without making it meaninglessly abstract is the real art of software development.

Unless you're the document management provider that Daef works with. They have a very different approach for how they integrate new features and custom code paths.

if(CustomerID == 15531) {
    //That Customer pays for red cells - 
    // - he should get them
    cell.Backgroundcolor=Color.Red;
} else {
    cell.Backgroundcolor=Color.White;
}

This is just an example. The code base is littered with these sorts of branches, with hard-coded customer IDs creating custom features which apply for only one customer. For now, anyway, because eventually, another customer also wants the same features, and these branches get longer and more complicated, and they frequently gate extremely complex and important business logic. The result is a spaghettified mess.

And don't worry, this is just the most widely used document management software vendor in Daef's geography, so it's not like a lot of companies depend on this software for their daily operations.

[Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!

This post originally appeared on The Daily WTF.

Leave a Reply

Your email address will not be published. Required fields are marked *