Do your best

… even if no one’s looking.

Today, I’m going to tell you a lesson I learnt from a fantasy novel. Well, I can’t remember which particular book, but it’s the Belgariad series by David Eddings.

That thing under the cart

The main character is Garion, a young boy who lived on a farm. There was a blacksmith named Durnik who sort of took care of him when Aunt Pol was busy.

So one day, Garion was asking Durnik why he was paying so much attention to a piece of metal that’s going under a cart. No one’s going to be looking at it. That piece of metal just had to be attached enough so the whole thing didn’t come loose.

Durnik told him that it didn’t matter if no one’s looking. He’s still going to make it as sturdy as possible. Because if nothing else, Durnik himself would see that cart, and he’d always think about how he didn’t do his best and he’d feel terrible. And he would see that cart everyday.

Black boxes

So I took that to heart. Maybe David Eddings didn’t mean it that way, but I felt that was important.

And when I started programming, I put in effort. Even the parts of code that aren’t really important. I tried to make sure they’re understandable or efficient or sometimes just plain elegant.

During my “professional” programming days (I would consider working at a company “professional”, but I still consider myself writing professional code now), there were many “black box” code. You know the type. You don’t really know what that code does internally, but it does what it’s supposed to do given specific inputs, and you’re scared to change anything about it.

There was a time when I was responsible for writing maybe 60 to 80 percent of the code (I was in a small team), and sometimes, I had to write the code in a certain way that I’m practically certain only I could understand it (because it’s math-based or the logic was slightly convoluted). I wrote the code as clearly as possible. I added comments to aid understanding.

For example, I had to explain a little about partial fractions because I couldn’t assume the programmer/reader would know about partial fractions. Even if they did understand partial fractions, I still had to explain why I wrote the code that way. That’s because I rearranged terms so the correct result came up from an SQL query. Yup, I wrote an SQL query with partial fractions involved. I think there were 7 or 8 lines of comments for 1 line of SQL query.

But the main reason I put in effort is because I want to feel proud of what I’ve accomplished and written. Maybe my supervisor don’t care. Maybe my peers don’t care. Maybe the open source community don’t care. Maybe the social media sites don’t care. Maybe businesses don’t care. Maybe that cute chick at the coffee club don’t care.

But I care.

And that’s more important.