Disable GC entirely

Manu turkeyman at gmail.com
Wed Apr 10 02:34:52 PDT 2013


On 10 April 2013 19:19, Dicebot <m.strashun at gmail.com> wrote:

> On Wednesday, 10 April 2013 at 09:12:33 UTC, Manu wrote:
>
>> ... nar, I don't think so.
>> A class is a class, I'm not arguing for anything that's
>> kinda-like-a-class,
>> I'm talking about classes.
>>
>
> The question is then "what is class?". Because the very reason to have
> class is to have guaranteed polymorphic behavior, so that working with
> object via its base will always make sense without any fears about what
> behavior can be overriden. But that is mostly needed in OOP hell with few
> practical cases like plugins.
>

I think I've lost you here... this doesn't make sense. Where did I say
virtual was bad, and it shouldn't exist? And how does my suggesting affect
any guarantee of polymorphic behaviour?
How is working with an object via it's base where only a small subset of
the functions are designed to be overridden any less convenient? It makes
no difference.
What's more convenient is it's much more obvious what the user is meant to
override, and what it should do (presuming the rest of the API is designed
in a sensible way). The self documenting nature of the virtual keyword is
nice.
It's also _MUCH FASTER_!


If essentially coupling data and methods is needed, that is what struct
> does. I am not arguing that everything should be virtual, I am arguing that
> you actually need classes. It is not C++ and, in my opinion, structs should
> be much more common entities than classes, especially in performance-hungry
> code.
>

Struct's are inconvenienced by other stuff. You can't create a ref local,
thus you can't use a struct as a class conveniently. It also has no virtual
table, how do you extend it conveniently? I'm not talking about struct's,
I'm talking about classes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130410/8d6ebabc/attachment-0001.html>


More information about the Digitalmars-d mailing list