Saturday, February 14, 2015

Week 6: Summary of Object-Oriented Programming Concepts

My summary of Object-Oriented Programming Concepts:

Object-oriented programming is a type of programming that involves defining data as variables, and defining how variables interact within a program.

Objects are how data is stored into a program through code.  They can represent simple boolean "True/False" information, single variables, sets of variables, lists, and can even represent complex systems found in real life.  Objects represent theoretical data structures that can hold, interpret and output data.

Functions are the ways in which variables and data interact within a program.  They are essentially a list of instructions which take in information, and output information that were computed from the initial input.

Classes are blueprints that are used to produce a specific type of object.  Classes allow the input of variables, and create either a solid or abstract data structure.  Classes have variables attached to themselves which are usually access in Python as self.variable (although "self" can be defined as any variable name, to represent the class itself; using "self" is convention in Python).

Classes have methods, which are internal functions specific to the class.  The methods allow for internal data manipulation, and can be used to perform certain actions (functions) that are specific to the class itself.

Classes can inherit aspects, variables and methods from their superclass.  A superclass passes on certain attributes to their subclasses.  In this way, superclasses are generally abstract data types, applying to a wide variety of subclasses, but requiring a subclass to function properly.  Superclasses are the "bare bones" that can apply to many subclasses.  When a superclass passes on an attribute, variable or method to its subclass, it is called "inheritance".  This genetic term manifests elsewhere in object-oriented programing, as superclasses can also be called "parent classes", and this reciprocates through generations (grandparent classes, etc.).

Modules are pre-constructed sets of files that possess pre-defined variables and functions, and allow for specific data manipulation (such as the "random" module that can be imported, making it unnecessary to create randomized functions for a program).  Modules can speed the process of programming as they can possess objects and functions that the programmer may need in their program.

Interfaces are the point of interaction between a user and a computer code.  It allows the functions of the program to be shielded from the user, and allows for a more "user-friendly" means of interacting with the data and functions in a program.

Object-oriented programming is a good method of representing real life systems, as it allows data structures to resemble real objects and interactions if the programmer constructs the program properly.

Tuesday, February 3, 2015

Week 5: Tracing Recursive Functions

I found that tracing recursive functions was quite redundant.  I had a hard time concentrating on them, as they felt quite unimportant.  The feeling was similar to writing out, line by line, the steps to solving a simple equation.  While it is important to understand when first completing the function (to find its eventualities), it is not necessary to do in most instances (especially by hand).  It is useful, however, in figuring out how a function works, and what methodological steps it uses.

I did enjoy learning recursive functions as they are an important aspect of programming, and I enjoy the mathematics of them.