Programming Value System

From a comment by Ralph Johnson on the Extreme Programming page:

... with the right value system, making good short term decisions leads to good long term results. The problem is getting the right value system.

This is true outside the realm of programming, too. I think that is the purpose of a value system. We need to figure out the way to live so that when we are the middle of life we "do the right thing". When our neighbor comes over to argue with us, we are not going to start thinking about how this will effect our life ten years from now, but we react according to the way we were taught, and the way we taught ourselves. The time for reflection is when things are quiet, and that is when we should decide to be peaceful or to stand up for our rights.


The problem with the notion of value system is that it is recursive. What value system do you use to know if a value system is good? -- oogoody

Your feelings, more or less.

Very true, which is the problem. As long as people realized this and acted accordingly more would be well. Instead people actually think their beliefs have a meaningful existence that must be defended. -- oogoody

What people? What beliefs?


I think this reasoning is exactly backwards. It's like saying all the decisions made by a soldier in the trenches will win the war. It don't work that way. -- oogoody

How do you get that from Ralph Johnson's bit? It's more saying that a soldier acts according to his training. If his training is good he will help win the war. -- Tom Ayerst

He essentially said maximizing locally (short term decisions) maximizes globally (long term results) and that the same values that work locally work globally. The individual training of a soldier does not win the war. You fuzzed by saying help win the war, which is unarguably true, but is not the correct sense. -- oogoody

I'm sorry but that really isn't how I read it. Consider the growth of the brain. -- Tom Ayerst

What needs to be defined is the scope of what 'short term' means. What is good short-term for the soldier, is not necessarily the same for his unit. The needs/desires of the individual do not always coincide with the needs/desires of the whole. The question is, where do we place the emphasis, the whole or the individual?


What he actually said is that with the right value system local maximization does a good global job. This isn't the same as saying that local maximization of your actual long-term objectives will work; it's saying that our global problems can be solved locally if we decide our local priorities carefully enough. He specifically did not say that "the same values that work locally work globally". (He could be paraphrased as saying "there are local values that work globally", I suppose.) -- Gareth Mc Caughan


Let's look at this logically. A decision made based on short term evaluations has an unknown affect on the long term. Similarly a decision based on long term evaluations has an unknown affect on the short term. Decisions should be based on both short term and long term evaluations. To ignore one or the other is to invite disaster. -- Wayne Mack

Consider an Ant Colony. Each ant makes a series of simple, short term, local decision and yet the colony exists over a large area for a long time... -- Tom Ayerst

It's a study in feedback. Short term optimization is easy to understand because feedback on short cycles is still working on initial states (approximately). In other words, it's easier to remember how the action produced the effect. Long term feedback is more difficult because by the time you are in the effects, you've likely forgotten the actions (causes). It takes a more mature memory system to make long term feedback work. In an intellectual society, this means you have to write things down and revisit the subject periodically without external stimulus. If you do that, then you may learn interesting techniques, like "losing the battle to win the war". Ants don't have intellect, yet they make the short term individual sacrifices that further the colony. Why do they do that? For lack of a better explanation, because it feels right, even though to an observer it may look as though it should feel wrong. That, I believe, is the value system Ralph is talking about, although he was definitely discussing humans. Something - and it doesn't have to be through logical, intellectual construction - makes doing the "wrong" short term thing (which happens to be the "right" long term thing) feel right at the time of the doing. It would make an interesting study to find out how such value systems evolve in non-intellectual life, such as ants. I envision staggered or cascading feedback loops that over time become a reward system of sorts. -- Walden Mathews

Going back to an earlier comment:

A decision made based on short term evaluations has an unknown affect on the long term. Similarly a decision based on long term evaluations has an unknown affect on the short term. Decisions should be based on both short term and long term evaluations.

This is true but incomplete. A decision based on long term evaluations has an unknown effect on the long term. A decision based on any evaluation will have an unknown effect on all reference frames. The best we can hope for is some fast feedback to steer by.

A huge amount can be done with localized control. The trick is building the structure (value system) right to let it work. -- Tom Ayerst

Exactly. I think Wayne Mack may be missing the point that choosing what local optimizations to do is itself an exercise in global optimization. No one is proposing to "ignore long-term evaluations". -- Gareth Mc Caughan


(I'm aware that much of the following is a restatement of what Tom wrote above. But sometimes I think it's helpful to explain things from two different directions... -- glv)

Let's look at this logically. A decision made based on short term evaluations has an unknown affect on the long term. Similarly a decision based on long term evaluations has an unknown affect on the short term. Decisions should be based on both short term and long term evaluations. To ignore one or the other is to invite disaster. -- Wayne Mack

This is true, and (as Gareth notes) we aren't proposing to ignore either.

The difficulty is that it's impossible in a practical sense to make a thorough, reliable evaluation of the long-term consequences of any non-trivial decision. Furthermore, it's impossible to even come close in the short span of time we frequently have to make a decision.

So what to do? The answer is that over time, by observing and experiencing the results of decisions, you can build a "value system" (that is, a set of rules for making quick decisions based on local or short-term input) that will, more often than not, result in good long-term results. This is one form of Emergent Behavior.

"Value system" is an unfortunately loaded term in this context. Ralph's quote seems to me to be focusing on the purely practical aspects of value systems: they are distillations of long experience about the way the world works and the results of different kinds of actions. This is independent of any inherent moral correctness that a value system may or may not have. As a Christian, I believe that my value system is rooted in objective reality about what is right and wrong. But that doesn't stop me from observing that (for example) being honest about things isn't just right, but also nearly always produces better practical results. -- Glenn Vanderburg

It gives me a funny feeling to see people debate about the meaning of my words. Are my words really that important? It is also odd that nobody asked me what I meant. I think Glenn figured it out pretty well. -- Ralph Johnson

For Ralph: What important thing did he miss?


A fascinating article. I hypothesise that small organizations can do this, but large ones can't. Also the more people you have, the more likely it is that one expert's intuition will conflict with another's. Note it says, "They don't need the best solution. They just need the one that works." -- Matthew Astley


See original on c2.com