[Your Opinions] Inheritance
I'm well aware of the advantages of inheritance. If you're not, ask us ;)
But I'd like to know, how often do you actually use it in your applications? I myself have used it just two times in total. (I know, VB6 doesn't have inheritance, I used our favorite pseudo-inheritance) And in those cases too, the usage was not very significant.
The way I see it,
1. Inheritance is something that jealous C/C++ programmers like to talk about in front of a VB programmer to vent their jealousy. I'm sure you've heard people referring to VB as a "toy" language, when the fact of the matter is, it can be much more than that, depending upon the implementation methods you choose.
2. VB programs don't really need inheritance. Like I said, again, I've only used it twice.
Of course, this is just my opinion, so that make it right. But I'd like to know your opinons on this. Since we have different visitors coming at different times, I'll bump this topic every couple hours for more inputs.
Edit: Also, how many times have you used it? Do you personally ever see the need for it, or have seen the need for it?
:afrog:
Re: [Your Opinions] Inheritance
Quote:
Originally posted by mendhak
...But I'd like to know, how often do you actually use it in your applications? I myself have used it just two times in total. (I know, VB6 doesn't have inheritance, I used our favorite pseudo-inheritance) And in those cases too, the usage was not very significant.
...
Edit: Also, how many times have you used it? Do you personally ever see the need for it, or have seen the need for it?
:afrog:
Being fairly new to .net (but not VB) I've moved over to C# as my language of choice, I hope this doesn't preclude my opinion on this subject too much. Esp since C# isnt too far removed from VB anyway.
I use inheritance quite heavily in all of my programs, my record is 7 tiers so far!
It was such a liberating thing I just grabbed onto it and won't let it go for the world now :) I use my classes mainly for writing out realtime text (plain english) reports that can be sent to screen, file, email or printer. I wrote one class to handle printing (via Drawing.Printing namespace), another class to deal with file access as pertains to my needs (using IO and Text namespaces) a third to encapsulate console functions and interface with my app semantics.
The Email class inherited the file class, which in turn inherited the printer class and thus the screen class. So all I have to do is use the SendTo() function to email the report (which is the base class of the screen class) and a function called AppendText() which uses polymorphism (overloading / overriding) to decide whether to send the string to the PrintDocument(member of printing class), the screen or to a file.
Thus its possible for my apps to ask for user input onscreen and mirror that input in a written report without even indicating that the user had been asked at all!
Very sexy if I may say so myself. And that's 5 tiers of inheritance (if you inlude the base)
I'd be stuck if inheritance didn't exist. :sick:
.Net rocks, it lets thicko's like me to write reasonlably decent programs.