To say that the codebase at Andy’s client is sub-optimal would be generous. It’s a kludge on top of a kludge that was cobbled together by countless developers over many years. And as with many large and unwieldy information systems, distilling this beast into an understandable form is a challenge superseded only by the actual maintenance of the code.

As such, a brief snippet — a representative line if you will — offers perhaps our best glimpse into the heart of the system. And what a better place to look than its most tragic part: the database. Following is a portion of a line (a SELECT statement) that illustrates a pattern used over and over within the code.

 WHERE co.Id    = cu.CompanyId
   AND cu.Id    = cui.CustomerId
   AND cui.Id   = (o.ShipToCustomerId / 1000000)

For the database unacquainted, having an identifier in a table that’s the result of another identifier divided by 10,000,000 is just sick.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!