CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Raymond Lewallen

Framework Design, Agile Coach, President Oklahoma City Developers Group, Microsoft MVP C#, TDD, Continuous Integration, Patterns and Practices, Domain Driven Design, Speaker, VB.Net, C# and Sql Server

What are the object oriented languages?

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.


Comments

Doogal said:

"Unless you've been programming in C#, VB.Net, C++, J++, Visual FoxPro, Ruby, Python, Eiffel, Smalltalk, Java or Perl for awhile"

...or Delphi
# February 11, 2005 6:22 AM

Darrell said:

You don't really need method overloading in Python. Method overloading is really to facilitate strong static typing.
# February 11, 2005 9:29 AM

Dave said:

Also, I don't believe VB.NET supports operator overloading.
# February 13, 2005 6:23 AM

Raymond Lewallen said:

Dave, operator overloading will be available to VB.Net in 2.0
# February 13, 2005 6:33 AM

Daniel Moth said:

You state (slightly paraphrased):
"VB6 does not support polymorphism"

Sorry, that is plain wrong. Polymorphism via interfaces is very well offered by VB6.

The only thing VB6 did not support is implementation inheritance (making it object-based but not oo - we agree on that).
# February 13, 2005 4:47 PM

Raymond Lewallen said:

Daniel, you are correct. VB6 does support polymorphism via interfaces, but in my opinion this does not make it an OO language, which was the focus of the post: OO languages. This is actually an argument that can go on for days because I've had it before. Because VB6 is a static typed language and doesn't support implementation inheritance, as you stated, it doesn't support polymorphism in the true OO sense, which is via implementation inheritance. This was the focus of my statement, and perhaps I should have clarified better in my post what I was getting at and at least mentioned the polymorphism via interfaces. I think I'll do that.
# February 14, 2005 5:20 AM

Trang Le said:

Can someone please give me a real world(could be at work) example about OOP problem and how to solve it.

Thanks.

TTLE
# February 14, 2005 6:46 AM

Raymond Lewallen said:

Trang,

OOP is not a problem, it is a solution. The problem can be solved in many different ways, and OOP is just way to solve that problem. Think of any problem that you have to solve today in your present programming language, and then you apply object-oriented principles and design to come up with a solution. Your question should be reworded to say "Can someone give me a real world problem and an object-oriented solution?" This would take quite a bit of time to discuss in detail, but I'll try to put up a post on it soon, or at least find a link to something that already talks about it, of which there are quite a few of.
# February 14, 2005 7:10 AM

Trang Le said:

Thanks. Raymond Lewallen.

Have a great day.

TTLE
# February 14, 2005 7:15 AM

Daniel Moth said:

Raymond

I understand the context of your post and like I said and like you said we agree on the whole. I was focusing on the specific statement that VB6 does not supporting polymorphism. I see you updated your post (although I don't know who Dave is :-).

It is not important but we still disagree on that point. There is no "true" polymorphism. There are just many ways to achieve it. VB6 supports polymorphism.

The only reason VB6 is not a true OO language is due to the lack of implementation inheritance. Implementation inheritance is a "feature" of which only one benefit is polymorphism.

Cheers
Daniel
# February 19, 2005 7:21 AM

TrackBack said:

Polymorphism is not coupled to implementation inheritance
# March 16, 2005 3:49 PM

Nilson Santos F. Jr. said:

Actually, Perl supports every object orienting feature that any other language has. And then some more. As a matter of fact, a LOT more.
# June 8, 2005 1:22 PM

E.Alimpertis said:

Polymorphism is not applied only via interfaces. Polymorphism in fact is between parent classes and childs. VB does not support polymorphism because there is no inheritance. I am quite new programmer but i am forced to see older languages such as VB6. There is no oo in it. Just blocks of code!!! Noone uses classes
# February 4, 2008 8:42 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Raymond Lewallen

Working primarily in the public sector during his career, Raymond has designed and built several high profile enterprise level applications for all levels of the government. Raymond now works as a solutions architect for EMC. Raymond is an agile coach, Microsoft MVP C# and also president of the Oklahoma City Developers Group and Oklahoma Agile Developers Group. Raymond spends a lot of his time learning and teaching such things as Test Driven Development, Domain Driven Design, Design Patterns and Extreme Programming practices and principles, to name a few. Raymond is also an advocate of Alt.Net. Raymond is primarily a framework guy, so don't ask him anything about UI :) Check out Devlicio.us!