On Mon, 12 Jan 2015 21:37:27 +0000 aldanor via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:
> On Monday, 12 January 2015 at 20:30:45 UTC, ketmar via > Digitalmars-d-learn wrote: > > it even has `RefCounted!`, but it doesn't play well with > > classes yet > > (AFAIR). > I wonder if it's possible to somehow make a version of refcounted > that would work with classes (even if limited/restricted in some > certain ways), or is it just technically impossible because of > reference semantics? it's hard. especially hard when you considering inheritance (which is not playing well with templates) and yes, ref semantics. on the other side i found myself rarely using classes at all. i mostly writing templates that checks if a passed "thing" has all the neccessary methods and properties in place and just using that. with D metaprogramming abilities (and `alias this` trick ;-) inheritance becomes not so important. and so classes too. sometimes i'm using structs with delegate fields to simulate some sort of "virtual methods" 'cause i tend to constantly forgetting about that `class` thingy. ;-) OOP is overrated. at least c++-like (should i say "simula-like"?) OOP. ;-)
signature.asc
Description: PGP signature