Dependency Infection

I’m getting more and more comfortable with the fact that design principles just don’t come as naturally to me as I’d like them to. I need to study them. I need to practice them. And I need to search outside myself for examples of object oriented programming done right. When I find a great example, I get really excited because I feel smarter for having seen abstract concepts at work in the real world.

Example: You know who’s really good at OOP?

The Joker, that’s who.

Today we learned a bunch of stuff about dependency. Dependency happens when one part of a program needs another part of the program in order to function properly. If I built a program based on a Coke machine, the robotic arm that grabs the Coke would need to depend on the information passed along by the purchaser’s button press, or else it wouldn’t know what type of can to grab. If I changed the order of the buttons, the machine would probably send me the wrong beverage can unless I also reprogrammed the robotic arm. Thanks to dependency, that “reprogramming the arm” job is now a necessary part of the “change the button order” job… unless I can anticipate that the buttons might need to be changed around from time to time, and then find a way to plan for that eventuality in my machine design.

That planning process is one of the main pillars of OO design, and it has a lot to do with something called separation of concerns. I think. Someone correct me if I’m missing something, I just learned this as of this morning. But assuming I’m on the right track, separation of concerns is the art of telling various pieces of the program, “Do this and exactly this and only this. Know that and exactly that and only that. If you need help with something, ask only this one other thing for the right information. Anything beyond those three tasks is not your job. It doesn’t concern you.

The object oriented programmer is like a master thief who assembles a variety of tools to pull off the perfect heist. Only these tools aren’t just tools, they’re people, and they need to work together in perfect harmony. But here’s the catch: the whole score must end up in the master’s hands. None of the other thieves can get a piece. But how does that even work? How can you get a big and complicated job done without telling each worker enough information to rip you off in the process?

The Joker knows how. He comes in with a plan fully hatched and then implements each piece in turn. Good programmers do the same thing, only instead of bank blueprints and instructions for each wannabe master thief, they use whiteboards and pseudocode.

I’m not a planner by nature, but you can bet your ass I’m becoming one at DBC. The challenges are becoming more realistic now, and that means workloads too big to mess round with on the fly. It’s getting increasingly harder to write code that fixes bad code, because there are enough moving pieces that I inevitably write more bad code and create entanglements that turn my app into a brittle and inflexible mess. Like a house of cards ready to tumble if a single queen needs to be swapped out for an ace, strongly interdependent programs have objects that aren’t easy to update later on.

Think of the real world implications. Your client expected the project to come in on time and under budget, and you made it happen…at first. But now, they decide they want to change how user data is submitted, and you look at the source code and realize you have four other structures that assumed the user data format would never change. Now, your client thinks you just need to tweak a feature, and they expect to pay feature tweak money for the job. But you’ll need program rewrite money because you let your little thieves know too much about other thieves’ business. Guess who’s leaving in the bus full of money? Your code, not you.

Dependency management is a fascinating principle and I need to spend a lot of time practicing it this weekend, whether it’s alone, with a mentor, or as a cohort. We’ll all be meeting on campus tomorrow to hold each other accountable for our success as a group. A few of us could probably benefit from a phase repeat, but we’re trying to get that number down to zero through hard work, focused practice, and a healthy dose of empathy. The all-stars among us will focus on teaching the strugglers. Ultimately, we’ll all learn from one another. I plan to do a lot of teaching and even more learning as I try to break out of my comfort zone and work on the skills that good leaders need to have: patience, compassion, trust, enthusiasm, and the ability to see awesome potential in the people I’m working with. And I hope my partners will see my potential when I’m the slow learner in the pair.

When the idea for a cohort-wide learning blitz first surfaced, there were concerns that people on the bubble might not get the push they needed to pass – after all, how can you move ahead when you’re reaching back to help someone behind you? But someone suggested that the moderate-mastery coders in our group could pair off together and feed off one another’s similar skills to learn new things. Like a virus, optimism spread  through our ranks and got us really fired up to code during the hours many would have reserved for free time. The sacrifice will be worth it. This weekend will make us all stronger.

And that’s a really good thing. Because we’re not code or thieves or Coke machine arms. We’re human beings, and there’s no rule against us depending on each other a whole lot.

Bobolinks, assemble!


The Dark Hidden Meaning of Lilo and Stitch.

You think Lilo and Stitch is basically about surfing and aliens and Ohana. You’re mostly right. But buried in the movie’s subtext is a dark allegory to a deadly reality, and when you see the meaning you’ve been missing, you’ll never watch the movie the same way.

Was that intro blurb clicksy enough? I hope so. Let’s quit teasing and just put the thing out there, yes? Yes.

Lilo and Stitch is a movie about the plight of the American military wife.

I swear I’m not insane. Think about it for a second.

The movie starts with an international tribunal taking an unethical scientist to task for his crimes against…alienanity? Nature. Let’s just say nature. He has been experimenting with the building blocks of life itself to create a conqueror of civilizations. A killing machine. A super soldier. A super soldier with no real home and an identity suppressed beneath layers of intentional conditioning.

Are you seeing this?

Stitch breaks out of captivity and lands on an island with no major cities. There’s just no way for him to reconcile his combative instincts with life in this paradise (which happens to be the home of a major U.S. naval base). He is taken in by a girl and a young woman who spend most of the movie struggling to understand why this beloved addition to their family seems hell-bent on isolating himself and hurting those who try to get close.

Ahem, PTSD.

Stitch cannot provide for his broken family, because he himself is broken, divorced from normalcy by virtue of his twisted lineage. Only his mad-scientist creator celebrates him for who he is, but when Stitch gets out of control, out comes the assassin’s laser gun. He’s not the product of an intentional dehumani… dealienization. He’s just a bad apple who needs to be dealt with. This dude is Lyndie England with a couple extra arms.

And so Nani must provide. But she is burdened by this interloper posing as a pet. As Stitch subverts her ideals of family-ness, she is buffeted from job to job, straining to make things work while the echoes of militarization threaten to unmake all her efforts.

The conflicts are finally resolved when the threat posed by a foreign enemy brings out the hero in Stitch. Notice how the big mean sharkface is portrayed as an antagonist, even though he’s just a policeman trying to enforce his homeland’s laws? Operation Iraqi Freedom much?

Anyway, Stitch cute-and-fluffies his way out if a sticky situation, and returns Lilo to solid ground. But he’s still a wanted fugitive. Until a former CIA agent and current employee of a social service agency intervenes.

Ving Rhames represents a dwindling safety net for veterans returning from active duty. You will never read that sentence again anywhere.

We’re left with a family video reel that celebrates Stitch’s completed assimilation into polite society. He has not been left behind. Or forgotten. If only that were true for so many real vets.

Also. You know why that Ohana definition sounded so familiar when you first heard it? “Nobody gets left behind” is a gender neutral remix of “Never leave a man behind,” which is part of the Soldier’s Creed.

Stitch might not have been as hunky as Van Damme’s Universal Soldier. But he was more universal.

Intergalactic, even. I’m here all week, folks.