On Thu, 2007-03-22 at 22:21 +0100, Bram Moolenaar wrote:

> 
> Adding a third matcher won't happen soon, and is a big change.  It's not
> really needed to prepare for that.
> 
> The disadvantage of using a function pointer is that in the place where
> it's used you only see:
> 
>          myprog->exec(args);
> 
> You can't see which function is being called, and finding out is not
> that simple.  So when you browse the code this is like a dead end.
> 
> Using this keeps navigating much simpler:
> 
>       if (myprog->difficultregexp)
>               regmatch_old(args);
>       else
>               regmatch_new(args);
> 
> One reason why inheritance in object oriented programming makes our life
> more difficult is that you quite often don't know for sure which method
> is invoked.

Actually this is something I loved about OOP, you don't have to worry
about which method is called (assuming the correct one gets called). But
given the complexity of the existing code, adding more complications
would be a disaster as you say.

- Asiri

Reply via email to