To recap, what I've written on Object Oriented Programming:
OOP (Object-oriented programming) is simply a model for programming. It is centered on objects (obviously) as well as data. This differs from other models for programming languages, which typically are centered around actions and logic. Objects are abstract data types (ADTs). Furthermore, objects contain data, called attributes and code, called methods. Data classes, such as those used in Assignment 1 and in labs, are important in defining subclasses, as well as for creating special types of classes, like Stacks, Trees, and Queues. Inheritance, which is important for coding subclasses, is a more efficient way of programming (than to manually program each class). Through subclasses, those classes that share similar functions and methods, can also share code. The programmer would not have to write code twice (or copy and paste code, which can cause errors to occur). Therefore, Inheritance is more time efficient as well as a more accurate way of coding (less errors will occur).
Additionally, through object-oriented programming, programmers can create trees, which are extremely useful. Through a binary search tree, in particular, a programmer can search through thousands of options more quickly and efficiently. Since the binary search tree is set up in such a way that data is comparable. The data at the nodes to the left are less than data.node and those to the right are greater. Thus a programmer can write code to search the tree without having to search all the nodes in the tree, since it would know that is does not have to stop at the left or right node, according to the value it is searching for and the value at the data.node. Also, as when used in Assignment 1, object-oriented programming, can be used to make a general class with more specific subclasses, which can be used for other games (such as Subtract Square, Tippy, or Tic-Tac-Toe). Using object-oriented programming is very useful and has numerous advantages.
No comments:
Post a Comment