POV-Ray : Newsgroups : povray.off-topic : Learning C# : Re: Learning C# Server Time
29 Jul 2024 04:17:25 EDT (-0400)
  Re: Learning C#  
From: Orchid Win7 v1
Date: 29 Sep 2012 06:19:35
Message: <5066cb37$1@news.povray.org>
>> Heh. It amuses me that run-time polymorphism via inheritance is /the/
>> central contribution of the OO movement, and here I am reading a book
>> warning me not to use inheritance under any circumstances unless
>> absolutely unavoidable...
>
> So, what's their solution? You have to reinvent the wheel all the time?

Use interfaces instead.

> So if you need a linked list of widgets and a linked list of gizmos, you
> have to have two complete sets of add(), remove() and iterate() methods?

That is better handled with generics than any kind of inheritance. A 
better example might be a single-linked list and a double-linked list.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.