Friday, October 11, 2013

Hello,

Today I’m going to talk about object oriented programming and recursion. First of all I don’t really get the definition of object-oriented programming. I believe that it means that certain objects may have values and attributes that give the programmer a control over the specified object. I wonder what non oriented object programming would be. In any case, I believe that I should work on grasping the idea behind the latter by asking a TA  or just popping into the help center.


Recursion on the other hand is simply so hard to grasp. I can’t stop but thinking iteratively concerning the way I code. I The way I see it and have researched about the latter is that I leave recursion do what its supposed to do, and simply find a base case. To elaborate what I mean is that recursion works best on structures that are comprised of similar structures such as fractals. So in reality finding the base case where nothing recursive is returned is the trickiest part, but for the recursive part of the code I believe one should simply have a leap of faith concerning the latter.

Wednesday, October 2, 2013

Hello,

I would like to write my first topic on classes and inheritance. So we basically learned how to make a sort of abstract data type called stacks. Now I don’t really understand why we would call this abstract, because it is usually represented as a list. Here is the funny thing about stacks: the first entry in is the last one out, because as we append the material, we do so by appending to the end of a list and when we pop() a stack we just return and delete the last item of a list. A queue is the exact opposite, and instead of poping l[-1] we pop l[0].

I don’t really get why we use the latter but I do know how to implement them using classes and lists. Now here is the situation with classes, I do know how a class can inherit methods and attributes from a superclass, yet I still don’t understand what a subclass does with a method that it does not understand. Also if both the parent class and the superclass have the same methods, when called which one gets the priority.


I believe that im going to have to test this out and see whether the superclass or the subclass gets the priority.