Is VBA object oriented?

Asked

Viewed 1,214 times

2

VBA can be considered an object-oriented language?

Despite having getters and setters (or Letters… rsrsrs), implementation of classes, methods and attributes, lacks the concepts of encapsulation, inheritance, polymorphism, etc (or has and I do not know?).

If there are methods to implement all the concepts of POO, I would very much like to know.

Anyway, I would very much like to know if that language fits this concept.

1 answer

4


VBA is actually the Visual Basic language and uses version 6, whose last release came out 20 years ago. VB is object oriented? They say yes (there are those who question), and indeed much of what is considered OOP mechanisms is there.

The concepts cited are exactly this, concepts, so it is not in any language. Languages have mechanisms and not concepts. Of course, there are mechanisms that support these concepts. VB allows polymorphism, subtype inheritance and encapsulation, although it does not need a specific mechanism to get the concept, of course, it is better with it.

It is always possible to program OO in any language, up to Assembly. See more in Object oriented programming in C is possible?.

But don’t even try. VBA exists to create scripts, then it makes no sense to use object orientation on it.

  • 1

    In the link below has this same question that I did, the user Mathieu Guindon shows exactly what you said, showed ways to apply POO to VBA. https://stackoverflow.com/questions/31858094/is-vba-an-oop-language-and-does-it-support-polymorphism. I just didn’t get one thing, why it’s not interesting to apply POO to VBA.

  • I wasn’t so fond of that reply, it seems to me to confuse some things.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.