CallStream + project Euler

Learn to think about de-coupling

Flexibility is almost endless. CallStream based solution delivers bigger freedom to experiment, than a “normal” object+methods solution. And also it forces the programmer to think of decoupling idioms from the start. Which I consider as a very good thing indeed.

One more thing. Each and every CallStream based solution does not have to be completely flexible, and ultimately clever. For example, one could pose much more strict rules for the above, and start like so:

Above is not all singing and all dancing “workbench”, but still functional and flexible call-stream based solution. We can use our original solution unchanged to “stream in” any number of divisors we want, and then we collect the result.

Change management is the key

Now please carefully re-read everything once more up to this point, and try to record how the original simple requirement has changed dramatically.

This is just an abstract problem, but imagine if it is to be solved and delivered to a paying customer? Who is also a “typical” customer, who likes to add *and* more importantly remove “details” from requirements?

A typical interaction with a typical customer goes like this. The original requirement might have been:

Then (like us here) customer adds a “detail”, after let’s say two weeks.

This is perhaps the original problem no 1. But. Mr Customer is unstoppable by now. After 3 days requirements are changed again.

I am sure this is enough to illustrate the point. Add to the above all the requirements customer will make to “improve” the usability of each solution.

I am sure you understand, and I do not have to paint more of this “reality” picture. And now imagine you do not use a concept and mechanism like CallStream is. To implement these changes as improvements would be much more difficult.

And as in real life with real requirements, down the development line, more and more changes are simply impossible to implement. And in the same time call them ‘improvements’.


(first published 13 Apr 2010)

ps: We can talk about javascript code to implement the above if anyone cares to ask.

pps: We can also talk about c++ code to implement the above if anyone cares to ask 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.