Re: why no struct inheritance?
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Sun, 20 May 2007 16:24:12 +0100
Paul Werkowitz <newsgroups@xxxxxxxxxxxxxxxx> wrote:
Am Wed, 16 May 2007 18:32:04 +0100 schrieb Jon Skeet [C# MVP]:
[snipped]
Its a matter of opinion, ok.
But to your last statement I have a question:
There is complexity in adding the feature of deriving from structs.
There is also a benefit to it. The question is whether the benefit
outweighs the cost in complexity or not. I don't believe it does, you
presumably do. That's a perfectly reasonable matter of opinion.
What complexity do you see in the feature of deriving from a struct? We
have no polymorphism here, only the possibility to override functions and
add new ones.
And add new fields, presumably. However, you *do* still need to learn
what is and isn't now allowed, and what should happen in various cases.
There's more to learn, and for little benefit IMO. (I very rarely write
my own value types to start with, and can't remember ever wanting to
derive one value type from another.)
To write non-trivial programs in C#, you need reference
types, derivation, polymorphism, ..... the whole enchilada. Such a person
should be able to grasp the concept of derivation of value types, too,
IMHO.
Yes, but in the same way that someone who has learned a difficult
language (e.g. Welsh) should be able to learn a relatively simple
language (e.g. French). That doesn't mean they would instantly *know*
French having learned Welsh. They'd have more to learn. I'm all for
keeping the language as simple as possible unless there's a really good
benefit to be gained from adding complexity (e.g. the addition of
generics and nullable types). Just MHO though.
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- References:
- why no struct inheritance?
- From: not_a_commie
- Re: why no struct inheritance?
- From: Jon Skeet [C# MVP]
- Re: why no struct inheritance?
- From: Paul Werkowitz
- Re: why no struct inheritance?
- From: Jon Skeet [C# MVP]
- Re: why no struct inheritance?
- From: Paul Werkowitz
- Re: why no struct inheritance?
- From: Jon Skeet [C# MVP]
- Re: why no struct inheritance?
- From: Paul Werkowitz
- Re: why no struct inheritance?
- From: Jon Skeet [C# MVP]
- Re: why no struct inheritance?
- From: Paul Werkowitz
- why no struct inheritance?
- Prev by Date: Application.AddmessageFilter
- Next by Date: SMTP message to file
- Previous by thread: Re: why no struct inheritance?
- Next by thread: Re: why no struct inheritance?
- Index(es):
Relevant Pages
|