What's about virtual?

Jonathan M Davis jmdavisProg at gmx.com
Tue Sep 10 11:42:04 PDT 2013


On Tuesday, September 10, 2013 18:53:32 Joseph Rushton Wakeling wrote:
> On 10/09/13 11:32, Jonathan M Davis wrote:
> > AFAIK, no official decision has ever been made. It seemed like Walter was
> > convinced that it was worth it to make non-virtual the default, and some
> > discussion went into how to do the transition, but I don't believe that
> > Andrei has ever liked the idea, and Walter never said that it was
> > definitively happening, much as he seemed to have been convinced that it
> > should happen.
> I seem to recall that the killer argument consisted of 2 parts:
> 
> * Having final-by-default means having speed by default. If people's
> default experience is slower than C++, they will not hang around to
> work out why or discover that speedups are possible.
> 
> * With final by default, a missing "virtual" on a method can be
> corrected without breaking downstream code. By contrast, with virtual by
> default, a missing "final" on a method (or whole class) can't be corrected
> without a risk of downstream breakage.
> 
> The second was the one that really sold it to me.

What seemed to have convinced Walter was this interview

http://www.artima.com/intv/nonvirtualP.html

where the focus was on code maintainability and how C#'s approach to 
virtuality supported code versioning. However, most of the rest of the 
discussion and what most everyone else was looking for had to do with speed by 
default.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list