If your code’s reusable why can’t you use it?

I called a meeting with my team today to discuss an issue that’s been at the top of my mind (and the tip of my tongue, and the butt of my jokes, and the heel of my boot) for the last few years. You know how you have that feeling of constipation of the lip? It’s like you have something really important to say but no time/courage/appropriate words/availability/presence-of-mind to articulate. And then someone gives you milk of magnesia for the mouth. (Or whatever the constipation relief equivalent is for the tongue.) That’s a bit of the release I’ve had. Here’s the back story. The team has been discussing code reuse lately and taking steps to redeploy major sections of some of our projects. While I agree whole heartedly that we need to reuse some pieces I’d been noticing a pattern. I finally decided to do something about it.

I called a meeting. I prepared a power point. Mind you. I have no expertise at public speaking. I tend to come off as a rambler. Not nearly as direct and to the point as I am here online. I also tend to feel extremely nervous going into these meetings where I’m the host. There’s always some last second gotcha with the AV equipment that I usually could solve in 15 seconds or less but get too nervous to think through. Also I had my manager and I think (I have yet to confirm) my director on the call. They both know I’m a nut and overly passionate about agile development and I don’t want to come across as too egotistical. Suffice it to say I had the “you’re gonna sound like an egotistical idiot” jitters.

I had one thing in mind through out the meeting, one point that I tried convey throughout. “If your code’s reusable, why can’t you use it?” I’m sure this struck a nerve or two. But think about it. We all are on the same side here. We all want the same thing. We just want that thing through different channels. We want modular reusable design. It just so happens that we disagree on how we actually use source code. I use source code to feed my compiler until it barfs out a binary blob. You might use source code to literally run your program. (An idea that really only makes sense in the world of interpreted languages.) I like to use binary blobs to build/run an application while others feel as though the source code is what’s running. I think in terms of features and behaviors while others are way more comfortable thinking in terms of the literal source statements involved in achieving the same thing.

Today I questioned what everyone thinks of as reuse. In the end I put it out as an assignment and discretely as a challenge. The idea is to get some code, recent or old, code that either defines a feature or fixes a bug. The code should likely be something that you’re proud of. The challenge is to run that code in complete absence of the program that contains it. The exercise is to get the team thinking in terms of true modularity. I drew several analogies to explain my point. I’m not sure how successful I was because in the end engineers will be engineers and I’m no exception. We dove straight into the details and started debating specifics of his project vs. theirs, when/how to merge and branch, and other off topic stuff. The true point of sharing features was soon dropped on the floor.

Can you reUSE your code?
My question still stands on its own (as should your code). If you think you have a solid architecture prove it by taking a snippet of your code (a single bug fix or feature) and executing it completely outside of your project. Care to take me up on the challenge? Care to comment? Leave the details of your experience in the box below.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s