Re: A simple question for Abstract Class



Chris Uppal wrote:
Luc The Perverse wrote:

[me:]
IMO, the "abstract" doesn't add any safety, it just reduces
functionality.[...]
Hmm - for a novice programmer who doesn't know what he/she is doing,
something like a carefully placed assert or abstract class to prevent them
from doing something wrong can be very helpful.

I agree that safety is a worthwhile goal, I even agree -- with strong
reservations -- that safety is still a worthwhile goal even when the only
direct beneficiaries are people who don't fully understand the language.

What I /don't/ agree with is that declaring WindowAdapter abstract adds any
safety at all.

I think safety is probably a bad word to describe it, but there is some benefit to a newbie to tell keep them from instantiating a WindowAdapter.

On the flip side, I don't think there is any benefit to not declaring WindowAdapter abstract. You claim it reduces functionality, but there really isn't a plausible use for an instance of WindowAdapter.

--
Dale King
.