NOTE: As of July 12, 2009, this blog has been discontinued and replaced by the new Thought Delimited blog. All of the entries in this blog can be found there, along with new posts.

Applications Are Only as Beautiful as the Processes They Replicate

In an ideal application development process, you work with the client to get an accurate picture of all of the business logic involved in the process the application is supposed to handle, and the end result is a robust system built with clean, understandable code.

But it doesn't always work out that way (some would say it never works out that way). Most of us have had to deal with "scope creep." In fact, one could argue that most modern CFML-coding frameworks and patterns came out of the need to deal with "scope creep" and other reasons for changing our applications.

But sometimes the challenge in creating a clean application comes from the nature of the business "logic" itself, the real-world process that your application is supposed to mimic and replace. It occurred to me the other day that that is often the biggest hurdle I have to overcome with the applications that I'm asked to construct.

When I work with my clients to figure out what exactly what tasks the software needs to perform, I often discover that the processes at work are often riddled with exceptions and conditionals. Sometimes my clients are consciously aware of these exceptions, but other times I have to point them out and we have to figure out how they need to be dealt with.

We humans can handle exceptions within our thought processes very easily. Computer logic, on the other hand, doesn't handle exceptions so casually (which is probably why errors can be referred to as "exceptions"). Coding for even a single exception to an otherwise iron-clad rule can make the code involved twice as complex and perhaps a bit less than pristine.

While we do all we can as responsible programmers to deliver a beautifully-coded application, I think that sometimes there's no avoiding the touch of ugliness that comes from trying to represent and replicate an "ugly" human-driven process.

Comments
Finding ways to deal with the "ugly exceptions" is what design patterns is all about. Ideally the patterns can be modified as needed over time, since all business rules change.

Making code bigger and uglier to handle the business exceptions "this one time" is a big part of what makes enterprises less and less flexible to their marketspace. A good example was my century of misery at a bank that offered credit cards. When they started selling them in the 1960's, there was one and only one interest rate per card. By the 1990's, there could be an infinite amount (purchase, cash, promotional, etc). Retrofitting the myriad of systems that assumed there was only one interest rate per account was a giant undertaking. (They pulled it off only because they had bazillions of dollars; but interestingly, they eventually couldn't keep up anymore and sold themselves to BofA.)

Likewise, I was told that one of the reasons AmEx lost its prominence over the years was because their IT systems were "copy-n-pasted" around the enterprise as it grew, making it impossible to maintain them effectively as the marketspace (and regulatory environment) changed. This is evident to me today when I need to do even simple maintenance on my account--every task has a separate department, none of the departments know anything about the others, and each has its own 800# with its own office hours. Once that kind of siloing is entrenched, it's near impossible to break.

So good design in an IT application has a lot of implications for the ultimate health of that enterprise. That said, it's all a trade-off. There are certainly plenty of people who overengineer things. Finding the balance is an art. But that's why they pay you the big $$$ :)
# Posted By trebor | 10/28/08 11:40 PM
Oh, almost forgot: some of the problems you might be encountering come from the fact that you may be trying to, as you said, "mimic and replace" a "real-world process." Many times, I've found, users didn't understand the benefits of automation, and just wanted to put their inefficient desktop procedures "into the computer." The idea of automation, of course, is to streamline, which often means changing the process. Occasionally, though, users just can NOT get their heads wrapped around that. So good luck :)
# Posted By trebor | 10/28/08 11:46 PM
And that's a significant part of the problem: changing the human process, even if that change makes it better, is not always an option. Where I work, software (even commercial, top-of-the-line enterprise software) is warped to fit existing processes, not the other way around. It's an unfortunate aspect of the IT culture around here.

I certainly don't hesitate to advocate process changes when I think it's the best course of action, but if my customer decides that they don't want to make those changes, I don't have the clout to force the issue.

And having to accommodate those flawed processes can sometimes lead to some creative solutions that make it worthwhile, so it's not all bad.
# Posted By Brian Swartzfager | 10/29/08 5:03 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.1.004.