Saturday, September 8, 2018

The Belt

John got mugged while walking through a rough neighborhood and decided he would never let it happen, again.

Around the corner from his apartment was a dojo whose sensei was world-renowned, both as a competitor and an instructor.

He walked into the dojo and asked to buy a black belt.

"I don't sell black belts, here," said the sensei.

"I heard a black belt can make me feel safer on the streets," started John.

"People who have earned a black belt," said the sensei, "do tend to feel safer. That's true."

"So, let me buy a black belt from you. I promise. I've earned every penny I made."

"I'm not sure you understand," said the sensei. "It's not owning the black belt that makes you safer."

"I know," said John. "I have to make sure I wear it, every day."

The sensei sighed and shook his head. "No," he said. "The belt is just a symbol of what you have become after years of training. After you earn your belt, you still need to practice regularly to keep in shape and to maintain your discipline."

John screwed up his mouth and nose.

"Hmm," he said. "That sounds like a lot of work. Isn't there something you can do to just make me good at defending myself?"

The sensei smiled and said "You passed the test."

"Here," he added as he untied his belt. "Put this around your waist and wear it all the time."

John smiled and said "Thank you!"

"Don't thank me," said the sensei with a smirk. "You deserve this."

Friday, September 7, 2018

Space is Getting In

There are times when compromises and shortcuts actually make sense.

Imagine you live on a space station and a small meteorite has punctured the shell. There is probably a right way to fix it and, ultimately, you'll want to apply that fix.

Right now, as a friend of mine once characterized it, space is getting in.

Thursday, September 6, 2018

For Coupling, Ask "How Intentional Is This Dependency?"

Coupling needs to be controlled. One way to do that is to evaluate whether or not any given instance of coupling is viable.

Today's code quality question is this: "How intentional is this dependency?"

Note, it's not about how intentional the dependency looks. It's about whether a dependency actually is something you meant to put in place or just an accidental tag-along from what you really wanted to use.

Code Quality Questions

If it hasn't already happened, you will eventually develop your own sensitivity to the various code qualities.

While you are practicing, though, it is useful to have concrete, diagnostic questions you can use to determine the health of your design decisions and to guide your future choices.

To that end, I will start writing a number of entries tagged "code qualities question". Each entry addresses a single question you can ask yourself to help you analyze a single aspect of a single code quality. These entries start today.

Wednesday, September 5, 2018

Control is the Goal with Coupling

The code qualities aren't all unconditionally good. Nor are they bad. They just are. The effects are good or bad but not the qualities, themselves.

Coupling is one of the greatest examples of this fact.

You can't set a goal of eradicating coupling because certain kinds of coupling are essential to software design. You can't set a goal of creating coupling because rampant coupling makes a system all but impossible to maintain.

Tuesday, September 4, 2018

Done Theater

How done is done?

To me, done means (at the very least) there are no more engineering tasks required for deployment. In other words, as a developer, you can put the software in a customer's hands right this second and the only thing stopping you is some external force.

Monday, September 3, 2018

Hard Work Doesn't Always Pay Off in the End

I had a coworker who used to always say that lazy people were the best programmers. Her reason was that we don't like to do anything twice.

I think she was right that good programmers often look lazy. I'm not sure that the reason is what she thought it was.

When we bump up against a hard problem, most people have one of two impulses: Give up or try harder. Both of these approaches are unlikely to succeed - although they do both succeed more often than I would have guessed. Often, when you run into something really difficult, the best expenditure of time is the one that makes it a little easier.