On 10 April 2013 00:50, Dmitry Olshansky <dmitry.o...@gmail.com> wrote:
> 09-Apr-2013 14:18, Manu пишет: > >> On 9 April 2013 13:09, Rob T <al...@ucora.com <mailto:al...@ucora.com>> >> >> wrote: >> >> On Monday, 8 April 2013 at 08:21:06 UTC, Manu wrote: >> >> >> The C++ state hasn't changed though. We still avoid virtual >> calls like the >> plague. >> One of my biggest design gripes with D, hands down, is that >> functions are >> virtual by default. I believe this is a critical mistake, and >> the biggest >> one in the language by far. >> >> >> My understanding of this is that while all of your class functions >> will be virtual by default, the compiler will reduce them to >> non-virtual unless you actually override them, and to override by >> mistake is difficult because you have to specify the "override" >> keyword to avoid a compiler error. >> >> >> Thus successfully eliminating non-open-source libraries from D... >> Making a dependency on WPO is a big mistake. >> >> > final class Foo{ //no inheritance > final: //no virtuals > ... > } > > 2 extra words and you are done. The only problem I see is that there is no > way to "undo" final on a few methods later... Yes, it can not be un-done. And any junior/tired/forgetful programmer will accidentally write slow code all over the place, and nobody will ever have any idea that they've done it. It's very dangerous.