Final by default?

Dmitry Olshansky dmitry.olsh at gmail.com
Thu Mar 13 12:38:19 PDT 2014


13-Mar-2014 21:52, monarch_dodra пишет:
> On Thursday, 13 March 2014 at 15:57:22 UTC, Andrei Alexandrescu wrote:
>> At a level it's clear it's not a matter of right or wrong but instead
>> a judgment call, right? Successful languages go with either default.
>>
>> Andrei
>
> For what it's worth, "education" could help solve this problem: For
> example, "people" where surprised by the context pointer in nested
> structs, and now (I think), it is (or will become) second nature to
> always type:
>
> static struct S
> {...}
>
> Heck, I even do it for my global structs too now.
>
> So maybe the issue could be solved by educating to always type (by
> default):
>
> final class A
> {...}

Not the same as `final:` inside - the above just means you can't inherit 
from A. Funnily enough any new methods in A would still be virtual even 
if nothing can inherit from it!

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list