metacall()()()™ + project Euler

Learn to think De-Coupling


Flexibility of metacall based API’s is almost endless. Each metacall 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 metacall 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.

Now please carefully re-read everything once more up to this point, and try to record how the original simple requirement has changed gradually to be almost dramatically different to what it wa on the beginning.

Change management is the key

This example is just an abstract problem, but imagine if it is to be solved and delivered to a paying customer? Who is also a “typical-real-life” 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 metacall 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’.

Now imagine doing this without metacall based solution composed of particles of logic.  That, i am sure you know by now, will be a struggle.


(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 :)