So some questions have come up from the blog reading community about yesterdays post on
Encapsulation Defined.
Most of them were people asking me what polymorphism is, and what was
it called in VB6. Well, as far as what polymorphism is, thats going to
be its own post, but a quick and simple explanation is the ability to
redefine methods for derived classes. So, what was this called in VB6?
Nothing. You couldn't do it via inheritance. <em>(Update:
As Dave points out in the comments, VB6 does support polymorpism via
interfaces, but this is not in true OO fasion via implementation
inheritance, which is the focus of this article.)</em> Same
thing with implementation inheritance. Couldn't do that in VB6 either.
VB6 is not an OOP language because of its lack of inheritance and
overloading. Until the introduction of VB.Net and C# 3 years ago, the
only Microsoft languages that supported all 4 principles mentioned are
C++, J++ and Visual FoxPro. Someone please correct me if I left one
out. "Raymond, Visual FoxPro?! I don't think so!" Yes, for those of us
fortunate enough to have been programming in Visual FoxPro all these
years, we've had the benefits of OOP since Visual FoxPro 3.0 in the
early 90's, and we got the benefits of xBase prodecural programming
too. It was a schuweeet deal!
So, what I'm saying is that
1) Unless you've been programming in C#, VB.Net, C++, J++, Visual
FoxPro, Ruby, Python, Eiffel, Smalltalk, Java or Perl for awhile(Note:
Only Java, C#, VB.Net, Visual FoxPro and C++ support method
overloading, but all support operator overloading. Again, I'm only
fluent in half of these languages so correct me if I'm wrong), you
should read these articles on OOP principles. They will help you
understand just how capable OOP languages are and the wonderful things
they provide.
2) Even if you are an experienced programmer in VB6, you
should read these articles on OOP principles, because VB.Net provides
so much more that you had in VB6, and there is a learning curve
involved, part of which is understanding polymorphism and inheritance,
2 principles of OOP not available in VB until .Net arrived.