Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.ai.fuzzy    |    Fuzzy logic... all warm and fuzzy-like    |    1,275 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 598 of 1,275    |
|    Dmitry A. Kazakov to Maxim S. Shatskih    |
|    Re: Fuzzy Logic Operating Systems    |
|    21 Feb 06 11:15:20    |
   
   XPost: alt.os.development   
   From: mailbox@dmitry-kazakov.de   
      
   On Tue, 21 Feb 2006 12:12:45 +0300, Maxim S. Shatskih wrote:   
      
   >>> But this allows a lot of good stuff!   
   >>   
   >> No it is a contract violation.   
   >   
   > Why is this bad?   
      
   That depends. If your bank breaks the contract and plunders your money,   
   they also might see nothing wrong in this. It is a question of   
   Weltanschauung.   
      
   [ Though for a developer of a mission-critical system such attitude would   
   be irresponsible. Unfortunately it becomes somewhat common place. ]   
      
   > it allows lots of good things. For me, the "contract   
   > violation" is abstraction, pure theory, while re-dispatch on method calls   
   > allows lots of good stuff.   
      
   If you aren't interested in software quality, well, some people would never   
   board a jet, or drive a car, or turn a computer on.   
      
   Apart from being wrong, re-dispatch is also very inefficient. Furthermore,   
   it prevents a lot of optimizations the compiler otherwise might do.   
   Consider:   
      
   class Numeric   
   {   
   public :   
    virtual Numeric Foo (...)   
    {   
    const Numeric X = 1;   
    const Numeric Y = X + 1; // Can't fold this constant!   
    . . .   
    }   
    virtual Numeric operator + ...   
      
   >> obviously cannot be overridden. C++ does not capture this distinction.   
   >   
   > So what? Why is it necessary to capture this distinction? I have shown the   
   > practical case where such re-dispatch is practically convinient,   
      
   You didn't. You gave an example of a class-wide procedure which dispatches   
   within its body. It is simple dispatch. No re-dispatch is needed there.   
      
   Now, putting my software architect's hat on: a need in re-dispatch often   
   indicates a design problem. C++ let these problems slip undetected. There   
   is a very common special case, when an abstract method is called from   
   another method [the latter should be class-wide instead.] This gets   
   detected in Ada, which has saved lots of debugging.   
      
   >> I know no language which does multiple-dispatch right (=fulfills some   
   >> requirements I hold for important.) But this is a technical issue.   
   >   
   > Everything is a technical issue here :-)   
      
   See the example above. The operator + shall be double dispatching [or even   
   triple, if the result is counted], but it isn't in C++. This opens a can of   
   worms. Consider two siblings doing +. Now imagine that this happens in the   
   brake-by-wire system of *your* car.   
      
   --   
   Regards,   
   Dmitry A. Kazakov   
   http://www.dmitry-kazakov.de   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca