There are several weaknesses with traditional structured programming where data is stored separately from procedural code. Any code that is written as structured code is not modular. Because data elements are accessible from any code, it is possible for data to be modified without the developer's knowledge. This can result in runtime errors that are very difficult to debug. Additionally, maintenance becomes very tricky. Trying to understand the global impact of changing a line of code with structured programming can be very difficult. Finally, this reliance on having the programmer manage both code and data results in much lower rates of reuse.
Object oriented Programming (OOP) solves these problems. It packages data, and the methods that act on that data, into a single unit called an object. An object's data can be hidden to prevent unauthorized modification. The object surfaces a set of public methods to operate on this data. This concept is called encapsulation. Because implementation details are separated from the interface, the underlying programming logic can be changed at a later date without fear of breaking code that calls the object.
OOP allows developers to reuse code and data together through inheritance. By inheriting from predefined objects, developers can more rapidly construct complex applications. Since writing new code always has the potential for incorporating bugs, reusing tested code minimizes the chances of additional bugs.
In order to address these needs, the next generation of Visual Basic will provide additional language features that will make it a first class Object Oriented Programming language with all the benefits described above.
Comments