VB.NET and object-oriented ??

J

Julianna

Is VB.NET is Pure Object Oriented Language? If so, then how it is possible
to write VB.NET Console Applications without classes? For Example:

Module M1
Sub Main()
System.Console.WriteLine("Hello World.")
End Sub
End Module


Here there is no class used. Then how can we say it is a Pure Object
Oriented Language.
 
H

Herfried K. Wagner [MVP]

Julianna said:
Is VB.NET is Pure Object Oriented Language? If so, then how
it is possible to write VB.NET Console Applications without
classes? For Example:

Module M1
Sub Main()
System.Console.WriteLine("Hello World.")
End Sub
End Module

Here there is no class used. Then how can we say it is a Pure Object
Oriented Language.

Gladly VB.NET is not a pure OOP language only. VB.NET includes many
additional non-OO productivity featurers, but still supports PIE.
 
G

Guest

hi,

VB.Net is an Object oriented programming language because it supports all
the requirements like Inheritance, polymorphism etc.. Infact i should also
include the Structured exception handling also. To use or not to use any of
this function is a programmer choice. As far as your question is concerned,
it is true that here you are not creating any class. But if you look at its
IL code, you will see that VB.NET compiler has created a class in it. This
module is just to make the VB 6.0 people comfirtable with programming in
VB.NET and Microsoft has done its effort in making the VB.NET compiler
compatible with some good feature of Vb 6.0

regards
Nishith
 
G

Guest

Hi Julianna, nice to meet you!

I think you confuse the terms a bit... For example compare C and C++. Most
people agrre to the fact that C++ is a pure OO language, whilst C is not. But
yet you can define a

struct Car
{
};

in C++... but that doesn't mean it is less OO. What differes is that in C
you can't use inheritance like

virtual class Car : Vehicle
{
}

or polymorphism.

It is the same difference in VB6 and VB.NET... You can't write pure OO code
in vb6, but you can in VB.NET... But that doesn't mean that they have thrown
out all the old syntax and structures. The struct still applies in vb.net
(compare the Type keyword)... but it still provide you with all the tools you
need to write OO programs...

Am I confusing it? Please don't worry about the"pure" word here... But .net
framwork and vb.net is as close to "pure" OO you will ever come, I think.

/Henrik
 
L

Larry Serflaten

Julianna said:
Is VB.NET is Pure Object Oriented Language? If so, then how it is possible
to write VB.NET Console Applications without classes? For Example:

Module M1
Sub Main()
System.Console.WriteLine("Hello World.")
End Sub
End Module


Here there is no class used. Then how can we say it is a Pure Object
Oriented Language.


Does the class have to be where you can see it? The compiler wraps that
up in a class behind the scenes:

..class private auto ansi sealed M1

To be a POOL wouldn't it have to support mulitple inheritance? That is
not allowed in .Net so there is at least one strike against it...

LFS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top