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.

Monday, January 26, 2015

Week 4 SLOG: Reflections on my first few weeks.

I came into the class having never used python, as I received CSC108 as a transfer credit from a course I took on C++ from Carleton University.  I took that course 7 years ago, so I was lost at first.

I also have experience scripting in java and c# for gaming in Unity, but very basic coding.

I attended a ramp-up session, during the second week.  After my ramp-up session, I felt caught up.  I simply needed to convert the syntax from the languages I knew, into python, and everything made sense.

I am still unclear on the implementation of sub and super classes, especially when an application does not call to a super class function, but I am sure that will be made more clear in coming weeks and in more broader labs and assignments (the assignments and labs so far have been quite specific). 

Overall, I am really enjoying learning python, and feel it is a fairly easy language to grasp with a background in other computer code languages.  The programs I am making that are not for credit (out of interest) are helping grow my knowledge base in python.  I have not yet received a lab or assignment mark back, so when I receive those marks, I will have a better idea of how I am grasping the material.


 - Andrew Cooper
996660251

Tuesday, January 20, 2015

Week 3 SLOG: Why Geeks Need To Know How To Write

Computer programming and coding allows people to manipulate the processes of computers and machinery.  While codes are used to instruct a computer, it is often another human who will use the code to manipulate and strengthen it, or use it for other means.  Codes often get reused or recycled when they are fitting and work well in a given situation.  When working as a software engineer, the codes one creates can be reused numerous times by clients or fellow employees.  In companies that create programs or computer games, these codes may be reused and understood by a massive body of programmers who should be able to manipulate the given code with minimal explanation or communication.  Companies such as Facebook reused the Facebook HTML code, and as such, all of its thousands of employees must be able to easily understand and manipulate the code.  For this to happen, the code must be easy to understand and follow coding guidelines.

There are two primary methods of making code communicable to any programmer who uses it.  The first method is to use standardized syntax and guidelines so that all users of a specific code (such as python) can follow along and understand the code with ease.  The second method is to use notes and docstrings to explain and provide help with the code that is being used.  Both of these methods are used for effective communication to all programmers who use a code.  The second method, however, more specifically explains why Geeks need to know how to write.  Proper explanations that efficiently and coherently explain how functions and variables interact are a key aspect of a good-quality computer code.  Essential to this method is the ability to write, to communicate, and to follow proper guidelines.

Communication to other individuals who use a Geek's code is the primary reason that Geeks need to know how to write.

SLOG Started

This is my first SLOG entry, to ensure the site works.