Wednesday, December 5, 2012

Plumbing vs Coding

I like Plumbing... I also dislike plumbing.

One thing about plumbing is you have some time to think about stuff, like why it is I like it, yet dislike it as well. What I discovered was a bit of a revelation, but also a lesson I try to adhere to when coding. It all breaks down to one word 'Granularity'

I like using my hands to fix stuff and build stuff, it is such a great break from using only my mind to solve problems (like my day job). So why would I not like plumbing? I learned to do soldering and also what compression joints were used for many years ago while helping my Dad rebuild our house. Since then I have fixed up my own houses and usually do a good job.

This particular job had 7 soldered joints in it, the first one being a T that I cut into an existing cold water pipe to fit, then I would be able to create a spur to a new tap for the refrigerator. Now 7 joints is not a lot in the grand scheme of things, only any joint that leaks will be depressing. If a joint leaks you have to clean out the water from the pipe and dry it, then sand, flux and re-solder it. Once again turn on the water to see if the leak is fixed. As you can tell there is no real granularity as you have to complete the whole pipe with all it's joints to know that it is watertight.

Now lets look at me coding.

When I write a system, say a manager class and its objects class. I will write the manager class and make sure it compiles and links. Once that is done I will run its update and draw and setup functions. Once this works at runtime I will move on to its child class of objects and do the same thing. In all about 6 steps or close to it. Yet I was able to test each one, without breaking anything, or getting anything else wet, like a water leak would.

That is why I prefer coding to plumbing.

GRANULARITY Rocks... use it, it is a tool!

Laters
Da Voodoochief

No comments:

Post a Comment