Sunday, 15 February 2015

Week 6: Object Oriented Programming

OOPS, we're on week 6 already and just finally summarizing objected oriented programming (see what I did there ... again?)

It's been a bit of a ride, having just finished the first midterm and received the marks for both the midterm test and the first assignment. At the start of the year in September, we learned the hard basics of Python programming (by hard I mean literally, not difficulty-wise) - putting together a slab of functions, variables, and nearing the end of the course, classes. That was our first introduction to what was later perceived as "object oriented programming", in addition to "abstract data types". So, that brings us to the painfully obvious question: what exactly is an object? After reviewing some slides and doing some online digging, I came to a simple conclusion:

Everything in Python is an object.

Again, what does this entail? Well, everything in Python, from classes, functions, variables, methods, can all be passed as arguments to other, well, functions, methods etc etc. This means that they can be assigned to variables to be passed and have operations performed upon. Tying it to object oriented programming (or OOP for short), it essentially means that everything I've ever done in Python from the basics of arithmetic to module manipulations and recursions have all been classified as "OOP". Now, with the introduction of abstract data types of creating our own variables and classes, the idea of object oriented programming stretches a bit,

In creating our own variables and classes, I feel that we've stretched the boundaries of object oriented programming, yet at the same time progressed towards a better understanding of the subject/material. Hear me out:

Traditionally, I understood object oriented programming as operating with objects - that is, to create variables, and through a large series of functions/methods/operations, to manipulate and add on to a series of standard variables (str/int/float/list etc), thus the "stretching" of boundaries. Yet with Python and the concept of anything being an object, this fulfills my understanding of the concept of OOP.

No comments:

Post a Comment