C++ developer choices in open source projects
ketmar via Digitalmars-d
digitalmars-d at puremagic.com
Tue Oct 28 23:01:43 PDT 2014
On Tue, 28 Oct 2014 21:37:45 -0700
Walter Bright via Digitalmars-d <digitalmars-d at puremagic.com> wrote:
> 3. Inheritance and polymorphism are widely used
>
> It's my impression that D uses a lot more parametric polymorphism (i.e.
> templates) than virtual inheritance.
this is true at least for my case. i tend to write templates that
accepts entities that can do what i need instead of building class
hierarchies. my data reading primitives, for example, works with
any entity that has appropriate rawRead() method.
the only disadvantage is a size of a compiled binary, but i can live
with that. and if i want really small binary, i have to drop Phobos
anyway, and in this case i'd better use open()/read()/close() directly.
easy parametric polymorphism is one of those things that i absolutely
love in D.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141029/6fa8d5ab/attachment.sig>
More information about the Digitalmars-d
mailing list