On 10 April 2013 18:11, Dicebot <m.strashun@gmail.com> wrote:
On Wednesday, 10 April 2013 at 06:03:08 UTC, Manu wrote:
A base class typically offers a sort of template of something, implementing
as much shared/common functionality as possible, but which you might
extend, or make more specific in some very controlled way.
Typically the base functionality and associated accessors deal with
variable data contained in the base-class.

I believe that template mixins + structs are much more natural way to express this concept. Basically, if you need inheritance only for code reuse, you don't need inheritance and all polymorphic overhead. D provides some good tools to shift away from that traditional approach. Those can and should be improved, but I think the whole concept "classes are polymorphic virtual reference types, structs are plain aggregates" is very solid and area of struct-only development needs to be explored a bit more.

... 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 fact that I (and sensible 3rd party libraries I would choose to use) minimise the number of virtuals makes perfect sense.
It's faster, it's easier to understand, you can see what functions you need to override to use the object effectively at a glance, behaviour is more predictable since there are fewer points of variation...
Nobody has yet showed me an example of a typical class where it would make ANY sense that all (or even most) methods be virtual. (Again, not talking about small/trivial or foundational/container classes, people don't write these every day, they write them once, and use them for a decade, and they probably like in the standard library)