Are you dealing fatal blows?

Computer issues by Clint Spencer @ iStockphoto

When you code, do you write half-heartedly? Do you solve a problem to the best of your abilities? Are you disciplined in your work ethics? When your programming abilities are called to the fore, can you deal fatal blows?

The cat and mouse game

I’ve been following this manga series about a kung fu artist, Chen Min. During the early days of this young man’s training and journeys, there was once where he was under the tutelage of a master living in the mountains. For one of his training lessons, he was given a simple task.

Close to where they lived, a gorgeous waterfall gushed clear water from high up. To the side of this waterfall, a steep cliff stood resolute. There was this stone panel with words engraved on it, and the panel’s situated in the middle of this vertical rock-strewn wall face. The only positional clue was a small branch jutting out near the panel.

The task? Find out what those words were, or don’t go back to the master.

The cliff was too steep to climb with barely any hand holds. The only way was to jump off the cliff into the water below, and read the panel while undergoing free fall. Chen Min jumped down over and over, looked and squinted, but he couldn’t make out the words at all. Defeated, he sat down to rest.

On the grass near him, a small mouse sat. Sniffing at the air, it was nervously looking around. Then he noticed a cat, crouching quietly nearby, still and motionless. The cat moved a paw forwards. The mouse, catching the almost imperceptible movement, scampered forward.

The cat gave chase, springing forth with alarming agility. The mouse zigzagged its way, feverishly trying to throw the cat off. Rodent and feline blurred into lines of white, slashing through the grass in lightning streaks.

The mouse, nearing its limits, zoomed into a pocket of thick vegetation. The cat jumped right in, ignoring everything in its path. Branches swiped its body. Leaves flapped in its face. But the cat held steady, its entire focus solely on its white four-legged meal. Its endurance pushed too far, the mouse slowed, and the cat snapped it into its jaws.

From the chase he witnessed, Chen Min finally found the element he lacked. An ability to focus so intently as to block out every other distraction. He went back to the cliff. Before he jumped, he concentrated on that small branch, willing every cell in his body to focus on it, and the stone panel beside it. Then he jumped once more, eyes fixated on the branch. Closing in on the branch, he shifted his eyes to the stone panel. The words were, “bright mirror still water”, literally translated from Chinese.

When water is still enough, the water surface acts like a mirror. Sounds deep, huh? To be still enough, one must be focused enough. Yet too much focus, and one’s mind gets disturbed, disrupting the stillness. I’m still trying to understand this…

Anyway, from the cat and mouse chase, it seems that one false move triggers an action. If one does not react fast enough, there might not be enough time. Which brings us to the next point.

There is never a good time

So, in another part of Chen Min’s journeys, he’s at a monastery learning from another master. One day, the master decided to spar with Chen Min. After a few jabs here and there, the master basically gave the “stop trying to hit and hit me!” remark.

Chen Min gave his best, punching as fast as he could. He got in a few hits, and he was happy. I mean, he hit the master, right? The master just stood there, apparently unaffected by the attacks. Chen Min sprinted forth, followed the master’s movements to the right, gave a quick punch with his right hand, and hit the master squarely in the chest.

“When are you going to bring down this old geezer?” the master bellowed.

In an unexpected retaliation, the master sprung forwards and jabbed lightning-quick into Chen Min’s stomach. And Chen Min howled in pain, rolling around clutching his stomach.

“In a real battle, you only get one chance!”

So skimming forward a little, Chen Min was following his master through the busy market streets. There was a crowd gathering somewhere and they went to take a look. An industrious vendor had placed a weasel and a snake in the same cage, promising a fierce battle and much entertainment.

The snake clearly had an advantage. One bite with its poisonous fangs and the weasel was done for. The snake slithered slowly around the cage, taunting its opponent.

It jabbed! The weasel dodged barely out of the way.

It lunged! The weasel swerved to the side just in time.

Presently, the weasel found itself backed up into a corner. The snake, sensing its victory, advanced cockily.

For a split second, the snake got distracted and tilted its head ever so slightly to the side. The weasel grabbed the opportunity and pounced towards the serpent. The snake recovered in the nick of time and bared its fangs in retaliation.

Just when the two combatants were almost head to head, the weasel recoiled its head, swivelled sideways and clammed its teeth onto the snake’s head from the side. Sensing its impending death, the snake wrapped itself around the weasel, seeking to loosen the weasel’s deadly hold, but it was too late. The weasel bit down hard, because any quarter given would mean its certain demise.

In the end, the weasel won, because it took its one opportunity at striking. There’s actually more from the manga artist reinforcing this, with (another) cat and mouse incident, and a swinging pendulum with a broken bottle attached. Maybe I’ll talk about it another time…

The lesson to take away is this. The right time to do anything is the best time to do it. That, may not quite make any sense. Let’s look at it this way. For the weasel, there’s no chance for it to take the offensive. The only time it could was when the snake got distracted. The snake would probably not get distracted again. So the weasel really just had one chance. Just one. And that’s the best time to attack.

Focus and timing

When you’re coding, you need to focus unwaveringly on your solution. Not only that, you need to hold that focus for an extended period of time, because you’re juggling many things in your head.

Obviously, a long project is going to sap your strength significantly. Your deadline estimation is also going to depend a lot on how much discipline you can muster to focus, to keep yourself in prime coding state. In a large team, you’ll be working with other people, management, rules and regulations. And in a small team, or if you’re a lone wolf programmer, the only opponent is yourself.

The timing is never going to be right to fix that bug, to refactor that piece of code, to do what you most need to do (yet can’t muster the energy to do so). You only get one chance. Code it right the very first time, because you might not get another chance to correct it.

If you’re fortunate enough to be graced with a second opportunity, you’ll have to weigh the benefits of using your time on code correction, or on something else with better value. Perhaps decisions can’t be made with complete information at hand. Make the best decision you can without going into design analysis paralysis, but code with confidence that you’ve done everything you can to make it not suck.

Programming is about solving problems. The problem has already made its first move. Are you dealing fatal blows back?

  1. Aaron

    I often find myself giving up on programming tasks, something which I shouldn’t do. I guess I need to focus more on what I’m doing. And through planning, solve the problem properly the first time.

  2. Vincent Tan

    With a good solution, the programming part usually takes care of itself. I don’t always come up with a great solution, but I try hard, given whatever I know then.

    Doing it right the first time is a goal to strive for.

Comments are closed.