The onTap Framework is Ugly!

The onTap framework is ugly. Yep. You heard me, I said it. The onTap framework is ugly, and I don't mind admitting that...

As a programmer I spend a lot of time thinking about the "most elegant" way to solve a problem. Although in reality it's not really the most elegant way, it's just what I feel is the most elegant way that I can think of and that's currently available to me with my resources. It's always possible that someone else might have thought of a more elegant solution, or that there might be a more elegant solution that's simply not available to me, often due to financial constraints. The release of recent versions of ColdFusion and the addition of application-specific mappings actually resolved a number of ongoing issues I had personally with code I felt was "ugly" or "inelegant". And that's not the only time a ColdFusion upgrade has helped me to clean up something I had always struggled with. The addition of onMissingMethod made possible a long time dream for me of having a lazy-loading function library that could load utility functions on-demand. And don't think I'm being hyperbolic when I say "long time dream" -- I was trying to accomplish that with ColdFusion 5, immediately after CFSCRIPT was introduced and made custom functions possible in the first place. Yet with all the advancements to the core language, I still routinely struggle internally with this notion of "elegance".

Part of the problem is the way that people think. Scientists used to believe that humans followed a "path to action" like this: think -> do -> feel. So in this model, you would think about what you're going to do, do it and then afterward you would decide how you felt about that action. Was it good or bad? Should you do it again? This is a very logical way of handling the world, however, it turns out to be the opposite of the way we actually behave. Our actual paths to action (and this includes us programmers) looks like this: feel -> do -> think. This path is not rational, but it is very, very efficient, which is why our brains evolved this way. It's also the cause of what I've called opinion driven development (ODD). Andre Marquis explains how this works in this video here. In this model we have an emotional desire to do something like eat or play a game, we do it, and then afterward we rationalize that decision. Usually we create a "logical" explanation for our actions which is incorrect, because it assumes our actions were inspired by reason instead of our emotions. Even the belief that we behave rationally is inspired by our emotions -- it's uncomfortable to us to think that we might behave irrationally, regardless of how strong the empirical evidence is. And it's that discomfort, that very emotional discomfort, that makes it difficult for us to admit to irrational behavior. Although we can develop ways of thinking about things that allow us to entertain these ideas without that discomfort, specifically by developing a "growth mindset".

Knowing that much of my behavior is emotionally inspired, rather than logically inspired, explains a lot about the way that I struggle with "elegance". When I sit down to work, the initial desire is to create a compelling new solution to a problem. And when I say "compelling" I mean, a solution that not only will do what other solutions are already doing, but a solution that will do something that no existing solutions are doing, but should. As an example, the DataFaucet ORM tool started out as a relatively simple idea about how to create consistency and uniformity in the persistence layer of an application, so that any application I wrote could be heterogenously attached to any given database engine, despite the database industry's stalwart refusal to standardize. At the time most people weren't trying to do this at all, and a few people like Ben Forta, with more credentials than I, had already declared it "impossible". But by the time I read Ben's article, my tool was already doing most of the things he said couldn't be done. I didn't do these things because they were "hip" or "cool" in the programming community. At the time actually, these things made me something of an eccentric. If I'd wanted to be "hip" or "cool" back then, I'd have stuck to "best practices". Instead I chose to say "damn the torpedoes" and I cobbled together a system that, in spite of being hideously inelegant, worked. Time and several versions of the ColdFusion server have since improved that system quite a bit and it's now become what I believe is a rather elegant solution in most areas. And now that there's a proliferation of ORM systems in the ColdFusion community, even today it still does some very helpful things that none of the other ORM tools can't even approximate. Will the other ORM tools develop these same features? Maybe. But like I said, I didn't develop it to be hip or cool, I developed it to solve the problem of a lack of standardization in databases, so that when I sell my software, I'm not forced to tell my clients that it's limited to a specific database or a specific subset of databases.

Which leads me back to the onTap framework. Although I realize that I'm emotionally motivated for my software to have a particular aesthetic quality (say "beauty"), I've always strived to strike what I feel is the best balance between my desire for beauty and my desire for functionality. Specifically, I've always strived NOT to allow my desire for beauty to interfere with my desire for new, innovative solutions. I'm willing to risk falling on my face repeatedly and releasing solutions that aren't quite the way I'd like them to be, in exchange for the ability to create software that is genuinely new and genuinely helpful and not just relying on buzz-words like "OO" or "webservice" to make them hip or cool. It's funny and actually somewhat odd that I consider myself a "perfectionist", because I don't really believe in a "right" way to create software (unless I get to define it as "pushing the envelope"). Anyway, while I certainly would have liked to have won the "popularity contest" like some other folks in the CF community, it's never been my primary goal. And that leads me to the kind of conundrum I have with the onTap framework.

If you look at the latest version of the onTap framework today, you'll find that it's far more elegant than any previous version ever had been. I look at it myself and I marvel at what a difference updates to the underlying ColdFusion server have made - how much easier it is to work with and maintain now. And as I always do, I'm always on the lookout for ways to make it even better. Are there areas of the framework that become maintenance bottlenecks? Is there an area where I have to spend a lot of time in repetitive coding? How can I accomplish the same thing with less code? And when I find something I can change, will this change make a measurable difference? What's really ironic about this is that several years ago when the very first versions of Mach-II were released, I made several suggestions about how to improve the framework's design, and all of those suggestions were shot down by the Mach-II team at the time. Today, basically all of those suggestions are incorporated into the latest versions of Mach-II and when I've sat in on the "what's new in Mach-II" presentations recently (twice actually), the features that people say "wow, that's awesome" about, like automated page-views, are the ones that were shot down when I suggested them several years ago. Which might lead you to wonder why it is that the onTap framework community is so much smaller than the Mach-II community yet, when the "wow" features today are the Mach-II community just now catching up to the onTap framework's notions of "convention over configuation" development. But the onTap framework community is growing -- slowly -- but it is growing, and I expect it to grow more quickly in the not too distant future.

Well as I said, the onTap framework is "ugly". Personally I think it's maybe still ahead of it's time in much the same way that the Datafaucet ORM has been. The ColdFusion community at large has this funny tendency to broadly adopt things a few years after me, like happened with ORM tools. I'm not saying I'm perfect, far from. I make mistakes all the time. And it's only because I work so hard, because I put so many hours in and because I dare to try heretical new things that make people scoff, that I've been able to achieve what I have. And after a recent survey, it seems like the onTap framework is really more like what the broader ColdFusion community is "looking for" than are Mach-II or Model-Glue or really any of the frameworks that depend on XML configuration files. Does that make the onTap framework better than Mach-II? No, it just means that the underlying principals like convention over configuration appeal to a wider audience. But there's plenty of room in the ColdFusion community, just as there has been with Java or any other language, for there to be multiple approaches. I know that Matt Woodward, who's a good friend of mine and an important member of Team Mach-II, thinks about software differently than I do, and for him XML is more comfortable than conventions. And if you've read much of Pete Bell's blog, you know that his approach is also rather different -- in some ways very much like mine, except that he relies heavily on code generators, which I avoid like the plague. So as far as I'm concerned, different strokes are a good thing. ;)

But it is ugly. Not most of it. Most of it is fine for me honestly in terms of aesthetics, but there's one specific feature that has always bugged me. It's this file naming convention. If you've looked at all at the onTap framework or at the couple of plugins I've developed for it, you've probably seen directories with files like this:

100_someapp.cfm
200_someotherapp.cfm

Does that look like line numbers to you? It does to me too. And yes, I do have the same emotional response to the way that looks. I see it and I think "Ewwwwww! That's gross!" and I want it to go away... and then I keep working with them. The reason why I keep working with them is because after all these years (and remember that this came about with ColdFusion 5 originally), my emotional response to what looks like line numbers is still an emotional response and not a rational response. Would I like it to "look better"? Yes, absolutely! But not at the expense of either losing functionality or of making the framework more complex. And therein lies the big problem. This system that requires this file naming convention makes the framework extraordinarily flexible and simple. It allows me to do more with less code. Every time I've thought about devising some way to replace this system with CFCs or even potentially with XML, I've always reached the same conclusion. Every system I've conceived to eliminate that file naming convention does two things:

  1. add complexity (usually a lot of)
  2. eliminate flexibility (usually a lot of)

Both of these things are, if I force myself to think rationally about it, the opposite of what I want for my software. If you read any of the articles or books that are written by people who are devoted to the idea of improving software design, like the Gang of Four book on design patterns, you realize that reducing complexity and increasing flexibility are the big points they emphasize. What you'll find conspicuously missing from their commentary is mention of the code "staying within your comfort zone" by doing things like not resembling line numbers. So for now, I let it be and I swallow my pride over creating aesthetically pleasing code in this one instance because the ability to do more with less is still more important to me than "looking good" or being hip or cool. But I'm just one guy and although I like to think that I've considered all the possibilities, it's just not likely. If you've got any inspiration for an approach that would allow us to keep the flexibility and lose the ugly without adding a lot of complexity, that would really make my week. Don't worry about bruising my ego or making me look dumb -- I've done it to myself enough. :)

Historically I've never really been hip or cool. In high-school and elementary school I was a pretty weird kid and I got bullied a lot because I was different. I only really discovered the reason for it this past year when I received a diagnosis of Asperger Syndrome from a neurologist in Boston. So it's no wonder I haven't won any popularity contests. It explained a lot about my history, both in my early life and my unfortunate work history. And I've discovered that these kinds of work experiences are also very common for others on the autistic spectrum, leading to an 80% unemployment rate, despite the fact that most of us are competent to work. I'm in an interesting situation personally right now. A situation I never expected, a situation I was actually told specifically by my family would never ever happen, happened. Somehow I inherited a trust fund from my family, which has a very small investment portfolio.

It's a discretionary trust, which means that, although I am depleting it at the moment, the trustees won't allow me to deplete it indefinitely or completely. It is however giving me some leg room that I never had before and the ability to do something I believe in. The fact that people with Autism and Asperger Syndrome have an 80% unemployment rate is unacceptable to me. So I'm doing something about it. I'm working to change the stereotype from the "Rain Man", to a more appropriate stereotype of competent and passionate if somewhat eccentric people. In the not too distant future I will probably be the proud owner of some vending machines. Wha? Yeah, I said vending machines. :) The reason for this is actually fairly simple. I need to find a way to support myself financially (and I don't need much) that will leave me with enough free time to work on the much more important project of changing the unemployment rate for people with Autism and Asperger Syndrome. The vending machines will be a relatively low-maintenance business that will allow me to carefully select the projects I choose to work on. In my remaining time, I'll continue to work on the AutLabs project, a few very selective short-term programming contracts, open source software like the onTap framework, and my cartooning when I want to relax. :)

The reason I haven't been very active in the ColdFusion community in the past ... about 4 months... is because I launched the Autelligent Laboratories website and have been working diligently on promoting it and getting exposure. And unlike all my past projects, I've been very successful doing that. Now I feel like it's reasonably growing on its own, so it doesn't need to be something I focus myself on constantly anymore, and I plan to focus more on the ColdFusion community in the next few months. I'm going to get back in touch with Charley Arehart and talk about setting up a date for another onTap framework presentation for the online CFUG and I'll be doing more actual programming work on CacheBox, the onTopic forum plugin and maybe get back to that idea of a CMS plugin (or two).

Oh and I'm also now on Twitter, so say hi. :)

Comments
Oscar Arevalo's Gravatar I agree with you; If you really want to be truly original, you HAVE to march to your own beat. Even if at times you seem to be only leading an army of one.

Keep up the great work!
# Posted By Oscar Arevalo | 6/18/09 4:51 PM
ike's Gravatar Thanks Oscar. :)
# Posted By ike | 6/18/09 5:35 PM
Thomas Loyd's Gravatar Ike,
I really like your post once again. Whoever said code had to look pretty? Organized is much more important than pretty. And as far as organization is concerned, numbers are pretty darn efficient when it comes to organizing and you've got a winner on your hands. As a linguist, I can't think of something that works as well as numbers. Phonetically, Phonologically, Morphologically, Semantically, Syntactically, etc. Nothing can organize a system of logic like numbers. They are infinitely flexible and why databases thrive on numbers as artificial keys, not GUIDs, etc. There are too many imperfections that come into play when you try to use something as unorganized as language.

Anyway, I've been looking at onTap for a while now and have decided to start putting it to work for me. Keep up the good work dude!
Tom
# Posted By Thomas Loyd | 6/30/09 5:22 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.5.006. | Protected by Akismet | Blog with WordPress