The Man, The Myth, The Legend: The KungFooMater

The KungFooMaster is Bradley Jones. To find out more about me personally, read My Lifestory.

Probably, the thing that I'm most obsessed with (professionally) is software design. How we design software speaks as much to philosophy as it does to anything else. There are literally millions of ways to get any given program to work, and I certainly don't advocate the idea that there is only ONE true way. But, there are someways that are decidely better than others.

How we approach the design of software depends a lot on our world view. That is, what facts do we believe to be true about the world in general. We can logically deduce from the axioms to make arguments in favor of one approach over another, but obviously if one does not agree with the axiom, then all arguments based on those axioms do not necessarily follow.

What axioms do I hold? Well, the first axiom is that human beings make mistakes, and quite often. Knowing that humans are falliable input sources for programs, how do we make sure that a program works? Well, first we have to know, whether our program works or doesn't. In order to know, we have to test. How much do we test? A study DeMarco and Lister (the authors of peopleware) concluded that professional programmers average 1.2 bugs for every 200 lines of code. This means that inorder to catch 95% of the bugs, you'd need 1 test for about 20 lines of code.

The smallest atomic unit of a program that we can test is a function. This implies that no function in the system should be longer than 20 lines. I'm not a strong advocate of testing every function of a program however. One line functions probably don't need tests, since these functions are presumably called by other functions in the system and tranlate into one line. And therefore tested as well in other tests as it would be if it had it's own test case. Longer functions should have tests.

Tests find bugs, but they don't necessarily tell us where the bug is. The code itself has to be structured in such a way to support localization. I feel object-orientented programming is a good way to structure a system to have good localization properties. But, it certainly isn't the only way. And you can certainly make an object-oriented program that has poor localization properties. But, it is just the one I prefer.

Localization is the property that the bug detected when testing lines i..j exists due to lines i..j. Bugs are due to either the data that i..j depends, a incorrect control flow, or a bug in a function that i..j depends on. Of these, localization is a property of data dependence.

In order to be well localized the variables that a function touches should be local. The smallest scope for a variable should be prefered. Local variable over function parameter, over module variable, over global variable.

Bugs are introduced at a constant rate, per lines of code. This means, the best way to reduce the amount of bugs is reduce the lines of code that it takes to write a given program. Avoid needlesss duplication of functionality. Corrallary, don't copy and past code within a program. The other is avoid the needless duplication of data. The last one is especially important. Don't be afraid to compute. It is what the computer is made to do. Cache-ing the result of some computation is a very common optimization. However, it is a major source of bugs, because when the variable changes all the caches have to be updated. If you don't cache in the first place, you avoid this problem.

Vegetarianism

I'm a vegetarian. I became one during my second year as an undergrad as an experiment. I suffered no noticed ill effects so I continued to be one. The reason that I'm a vegetarian is a moral decision. I don't believe I can justify particapting in the active farming of animals. I came to this conclusion after reading a section in a book called "Anarchy, State, and Utopia" by Nozick.

I don't believe we should raise animals whose sole purpose from the time they are born into this world is to become food on the dinner table. I don't like meat that much. I don't like meat enough to kill a pig, cow, or chicken. Staying vegetarian is surprisingly easy, eating meat does cause me to become ill. Similarly, I don't like fur coats or leather that much either. I'm not a big advocate of vegetarianism. It is a decision that I made. You are free to make your own.

I realize that others don't share the same values I do. However, those of you that choose to be meat eaters, I do ask that you do some research on how the animals that end up on your plate are treated. Think for yourself, and approach it with a critical mind. Just because something was always done a particular way does not make it right. If you are really willing to participate in slaughtering of these animals. If you can do it with eyes wide open. Fine. I won't argue with you. I only ask you to respect the fact that I can't.

Pictures

Here is a photo of yours truly.

A photo of the KungFooMaster

There are also a bunch of photos of me and friends at UIUC at the nondot.org photo archive.

I went to ninja burger, and filled out a survey to tell me what kind of ninja I was. I was mildly amused by the result. KungFooMaster member of the Lo-Cal clan.

I just found this one humorous. Especially, after playing Warcraft III so much on battle.net. You get called a noob alot.

Evil Sponge calling a poor critter a noob

Slashdot

I post on Slashdot. My account name is IrresponsibleUseOfFr. It was supposed to be IrresponsibleUseOfFrogs (KungFooMaster was taken), but slashdot determined that name was too long.

Warcraft III

I play Warcraft III quite a bit. Here is my profile.

Links