For many years there has been substantial agreement that the content of the CS2 course should be a study of the classic data structures including, but not limited to, stacks, queues, trees, and tables. In recent years we have observed a move to the object-oriented programming paradigm for the CS2 course. At this point there is significant divergence as to the best programming language to use - C++, Eiffel, Java, Oberon, Python, or Scheme, to name a few. Although many agree that to be truly object-oriented, a programming language must support (1) encapsulation of attributes and behavior in a user-defined class specification, (2) instantiation of objects of pre-defined and user-defined classes, (3) polymorphism, and (4) inheritance. From a survey of recent texts for the CS2 course, it appears that there is heavy emphasis on encapsulation and instantiation with some treatment of inheritance and little treatment of polymorphism. There is also significant treatment of generic container classes supported by template classes if the supporting language is C++. If the supporting language is Java, then the container typically manages objects of the type Object. This paper makes a case that Visual Basic .NET could be considered a viable candidate for the CS2 course since it supports user-defined class specifications with the encapsulation of attributes and behavior, instantiation of objects of pre-defined and user-defined classes, polymorphism and inheritance. Additionally, there is full support for exception handling using the now, well-known, try/catch/finally semantics. Further, there is support for dynamic memory allocation and deallocation. And finally, the student or developer has full support for visual, event-driven, net-centric programming paradigm.This paper is a follow-up to a series of papers several years ago by the same author. These papers made a case for the use of Visual Basic in CS2 even though, at the time, Visual Basic was not yet fully object-oriented. This paper will present an implementation of a stack container ADT that is fully generic, that is, it may manage a collection of arbitrary objects that demonstrate polymorphic behavior.
Read full abstract