This post is mostly a whiny diatribe on how I’m a stupid idiot.
Mostly, when I code, I focus on logic: algorithms, object models and other back-end stuff. All the stuff that’s hard and doesn’t give any sort of gratification to the front-end developers or users because, well, it’s not on the front-end. The stuff I like to code are the elegant binary-keyed dictionary structures that route water in multiple simultaneous directions in a hydrologic model. It’s the stuff no-one sees.
Consequently, because I hate the design side,1 my apps generally look extremely rough, almost unusable, but damn do they do some cool shit. If it’s something that needs a front-end, I either do that last, or get the back-end working and then ship it out.
Recently, I took on a project for a fellow who’d been working for months with a developer. I pretty much thought I was going to “parachute in” and take this developer’s code and bring it to launch. Well, it turned out that the previous developer didn’t actually write any code. None. Zip. Instead, what they did was create long “what we should do” lists and emails.
And, they got a design.
So, the “code” I was given was not code at all. Rather, it was a really nice design from a third-party designer. Thus, rather than build the back-end to the site, I had a design that I just had to plug into. I decided to break up that design into views and plug them into my new Rails app directory before I started build models.
This, as it turns out, was a very serious mistake.
Because it seems that I have a certain workflow, and that workflow is to develop an object model based on the logic that is needed, and that logic is based on the function that the application is to perform. That’s why I work so well on the backend without a design. The bare scaffolding allows me to think about the object and not the layout.
In this case, I made the mistake of applying this design before creating even my first model. That was bad. Very bad.
The thing is, designs have all kinds of embedded assumptions. Usually, when the design is based on the logic, the assumption is “it has to provide an interface for this logic.” However, when the design is created in absence of the logic, then the assumption is something more along the lines of “well, hell, I guess it might need one of these.”
I didn’t ever realize it until very recently, but I now know that what I was doing was some weird, disconnected hybrid of design reasoning. It was something between “This is the most robust-yet-simple object model that I can start with and build from” and “well, the design says it has an X button, so I guess I’d better build an X model.”
Yeah, I know it’s stupid. The thing was, it all happened so subtly that I didn’t even realize it! I guess that, in other projects, by time the design is applied, the object model is solidified. Thus, if there’s a button, you can be damn sure it needs to be hooked up. In this case, there are buttons that pretty much everyone sees and thinks “Yeah, I don’t know why that’s there.”
So, today I was trying to work around 7 polymorphic models and at the same time I was thinking “this would be easier if I didn’t have to scroll past all the glitzy site images to see this whenever I look at it.”
That was when it hit me. I don’t. And more than that, the 7 polymorphic models I have are really only there because there’s this navigation bar, immediately above the glitzy site images, that says they should be.
So, believe it or not, I did the crazy thing. New repository, new Rails scaffold. Start over.
So now, it’s 4th down in the 4th quarter, there’s like 5 minutes to play until this prototype is due, and I’m dropping back to punt with a new Rails app that doesn’t have a design applied.
And I’m hopeful, because it’s actually a fairly simple app, just with a complicated design. But as a simple app, I know it’ll be simple for me to whip out, now that I have a clean understanding of the object model, and no design cluttering my thoughts.
Damn, it’s late in the game to come to this play, but at least I know better now.