|
And I was the first to vote that way I guess it pays being up late at night at whatever time it happened to be.
James
Sonork ID: 100.11138 - Hasaki
"Smile your little smile, take some tea with me awhile.
And every day we'll turn another page.
Behind our glass we'll sit and look at our ever-open book,
One brown mouse sitting in a cage."
"One Brown Mouse" from Heavy Horses, Jethro Tull 1978
|
|
|
|
|
The real truth is that MFC says "we don't use it" and all other people therefore don't use it, because:
a) what MFC says, must be correct or
b) otherwise they would write code that does not work with MFC anymore.
--
See me: www.magerquark.de
|
|
|
|
|
|
Really? at which class should I look, to see it?
(or do you mean "derive from CWnd AND nothing else" counts already as mutliple inheritance? )
--
See me: www.magerquark.de
|
|
|
|
|
|
Because you need information about the inheritance tree in order to make sure it works . Such information is not always available , and can be a real bugger to debug if and when MI eventually kicks you in the ass. If you have complete control of all source in a project then there is a case to use it .(I'm ignoring pure virtual base classes used as interfaces, where it is useful and safe ). However if you have complete control , then why not design so that MI is not needed and hence make debugging easier for those who come later ?
|
|
|
|
|
There are a lot of ideosyncracies about MI that can make it difficult to use and maintain. Since I have about 12 years or so of C++, I have used MI quite a bit. However, I only use it for my own personal projects. In situations where I'm consulting or programming for someone else where I don't know who will eventually maintain the code, then I shy away.
By the way, you'll notice that the C# design team intentionally left this feature out (as did the Java team I believe).
Cheers,
Tom Archer
Author, Inside C#
|
|
|
|
|
I don't mean to begin a flame war here, but... Suppose in a high-level design you come with some C tha IS-A A and a C . If you're programming for someone else, would you prefer explaining to her about the standard artifact in Java/C# for dealing with such situation (namely derive from an interface and delegate to a private member)? Is this more intuitive/maintainable than multiple derivation?
Seriously, MI is not such a common pattern, and can lead to obfuscated design, but when it is the appropriate thing to do it can save your life. It goes along with C++ philosophy of treating programmers as grown adults and let them have access to all the tools available, dangerous as they may be.
I know you're a C# guru, so I'd like to know whether there is a pragmatic reason for leaving MI out of this language. Does it make reflection or some other feature harder to implement? That could be a reasonable case against MI.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
>>>
If you're programming for someone else, would you prefer explaining to her about the standard artifact in Java/C# for dealing with such situation (namely derive from an interface and delegate to a private member)?
<<<
Many times when I consult or program for someone, I'll never meet the people that will eventually maintain my code. Therefore, I take it as part of my responsibility to use techniques that are what I feel are standard. It's been my experience that MI is not something that the average programmer fully understands. You'll also note that people such as Bruce Eckel of the C++ standard committee shares this belief and also recommends against using it accept in very rare situations where there are no other options.
>>>
...but when it is the appropriate thing to do it can save your life. <<<
I agree
>>>
It goes along with C++ philosophy of treating programmers as grown adults and let them have access to all the tools available, dangerous as they may be.
<<<
This has nothing to do with treating people as adults and everything to do with the practical realities that part of my responsibility as a programmer is to turn in code that 1) gets the job done and 2) requires as little in terms of maintenance and learning as possible.
>>>
I know you're a C# guru, so I'd like to know whether there is a pragmatic reason for leaving MI out of this language. Does it make reflection or some other feature harder to implement? That could be a reasonable case against MI.
<<<
If you look closely at C# you'll see many situations where the language left out features that are C++ because the risk/reward ration was deemed to high. Case fallthrough is a perfect example of this. Most experienced developers are not going to commit an error with this and love having it at their disposal. However, as Eric Gunnerson explained to me, its not technically needed (as there are other ways to accomplish the same thing) and only serve to get less experienced programmers into trouble. Therefore, while you might very well be a highly-competent programmer who knows MI inside/out, the simple fact is that it gets too many developers into trouble to be worth its risk with its inclusion in the language.
Cheers,
Tom Archer
Author, Inside C#
|
|
|
|
|
I think that IS A is *always* a contentious design decision. BEHAVES LIKE A is (almost) always a more conservative and pragmatic analysis. You should work on the assumption that the latter is the case, and only solidify to an IS-A relationship if you prove, late in the design process that the relationship holds.
Matthew Adams
Development Manager
Digital Healthcare Ltd
|
|
|
|
|
We were having nice simple polls like do you like the new VS.NET UI or how many of you like C# or some such nice simple stuff.
Now it's all templates and multiple inheritance.
And that Georgie Boy is not even to be seen.
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|
Nish [BusterBoy] wrote:
And that Georgie Boy is not even to be seen.
He's probably gloating
I don't mind George, he's a bit narrow minded, but at least he is passionate.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
Christian Graus wrote:
but at least he is passionate
True. If anyone can be called passionate, then George sure qualifies...
And he was always alone, facing the multitudes.
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|
|
It was kinda heroic I say
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|
Nish [BusterBoy] wrote:
And he was always alone, facing the multitudes.
Yes, but if I went to /. I would be the same, that doesn't prove anything barring that the greatest zealots are the ones who seek alternative opinions so they can disagree with them and feel the justice of their cause...
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
Actually this one was Troy Marchand's fault. We got into a discussion about multiple inheritence and whether or not you can do it in .NET and then one thing led to another and here we are
cheers,
Chris Maunder
|
|
|
|
|
Chris Maunder wrote:
whether or not you can do it in .NET
I thought you cannot!
Though maybe you can from C++ but even that I am not sure.
Can you have MIed managed classes?
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|
Nish [BusterBoy] wrote:
We were having nice simple polls like do you like the new VS.NET UI or how many of you like C# or some such nice simple stuff.
Now it's all templates and multiple inheritance.
"sarcasm=on"
Apart from the fact that this poll appears to be about "Inheritence" (I assume it has to be, since it was pointed out as typo some time ago and it's still not corrected) you seem to have missed the fact that any true .Net fan was supposed to slam on any C++ features that C# doesn't quite support on those polls. All you have to do is just to vote "I've never used templates" or "I see no need" for MI etc. You could also express deep desire to Internet-enable your application (no matter what) and you could take a good laught at those loosers who ship with the source code. There are endless possibilities just waiting for the real supporters of .Net to explore...
Nish [BusterBoy] wrote:
And that Georgie Boy is not even to be seen.
"sarcasm=mostly off"
As the CodeProject becomes more and more ".Net polluted" I simply tend to spend more time elsewhere. Oddly enought it seems like the old CodeGuru site has many good articles recently. I hang around SourceForge most of the time doing some coding, which is far more usefull and entertaining than wasting time on useless arguments. And that is where I can be seen quite easily - you just have to know where to look at
|
|
|
|
|
Welcome back george
George wrote:
Oddly enought it seems like the old CodeGuru site has many good articles recently.
Sacrilege!!!
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|
|
Colin Davies wrote:
gotta agree with you there
Colin
Since CP is an MS-fan site of sorts CP mus keep up with new MS trends. Surely you cannot expect CP to go back to 16 bit windows and DOS.
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|
But there is the concern that if CP gets too net'ish, then all the C programmers who write for Windows will go somewhere else.
I am letting my MSDN Mag expire. I am not going to renew WDJ. Will pickup C/C++ Users Journal.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Tim Smith wrote:
But there is the concern that if CP gets too net'ish, then all the C programmers who write for Windows will go somewhere else.
That's a sad thought. I don't want CP losing good C++ guys
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|