Abstract
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 predefined 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 the new Microsoft C# ((c)2001 Microsoft Corporation) language 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 predefined 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. The language also makes the distinction between pass by reference and pass by value function/method parameters by obvious keywords in both the formal declarations and in the call. The language also supports namespaces for the organization of software components. And finally, the student or developer has full support for visual, event-driven, net-centric programming paradigm.This paper presents 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.
Published Version
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have