Should certain abstract classes be instantiable?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Oct 2 08:00:26 PDT 2009


Jarrett Billingsley wrote:
> On Thu, Oct 1, 2009 at 11:48 PM, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> wrote:
>>> But.. you mark something abstract when you want it to be .. abstract.
>>> How would you argue that abstract is basically a no-op when used on
>>> methods with bodies?
>> It's not a no-op. Try it.
> 
> Yeah, not *currently*, but isn't that what you're proposing?

No. I think it would help going back to my original message instead of 
asking one-liner questions. This would work much better in real life, 
but it's a time sink in a newsgroup. You spend five seconds on asking a 
question with a foregone answer just because you don't want to invest 
fifteen seconds in re-reading my initial post, and then you have me 
spend five minutes explain things again. It's counter-productive.

If a class defines an abstract method and also provides a body for it, 
it still requires the derived class to override the method. So abstract 
still has some meaning.

On the other hand, technically such a class would become instantiable 
because it defines all of its methods. I wanted to explain that, 
however, that wouldn't be a good idea because... and here's where 1-2 
good examples would have helped. I guess I'm going to drop it.


Andrei



More information about the Digitalmars-d mailing list