Saturday, 21 February 2015

4: Object-Oriented Programming and Me!

So far, I feel as though Object-Oriented programming is both simple but complex. The idea and the thoughts are very straight-forward and logical, but when it comes to application, the code itself can seem quite odd. For example, when I needed to trace the execution of a queue function in our tutorial, what I thought would be the logical correct answer is not. Once I see my mistakes, I understand it and wont commit it again but I remain slightly uncomfortable with the idea; similar to accepting the idea that 2+2 = 5. You may be able to do it when it comes to applying it but it does not feel right or logical.
My mistake was in the order of which the objects are inserted, for example, let's take Q = [1, [2, 3], 4]. From what I understood, the function adds the first value 1 to the queue, then adds the value 4, then 2 and finally 3. This makes no sense to me, I imagined it would add 1 first and then dive into the second list and add 2, then 3, exit the list and add 4. In order to understand what happens better, I'm going to have to insert the queue function into the python visualizer to fully understand and see how the computer is taking and storing information in queues.

On a side note, I feel I did very well on the midterm and average on the first assignment. I hope to raise my grade in the next assignment and do just as well on the next midterm and, hopefully, the finals, too.

See you soon!

Thursday, 12 February 2015

3: Recursion. meh, I guess.

So in the 5th week we focused on the idea of recursion and how to trace a function that uses recursion. The concept to me, seemed a bit complicated at the start but it made sense after the first trace. Recursion is rather simple from what I understand; it's like using a helper function in a function, but the helper function is the same function as the one you're writing.

Weird... right?

We had to trace a couple of recursion functions on the midterm and it's rather simple; it's as though you follow the function line by line, as if you're the computer reading the program. From what I've seen, several people found recursion to be an odd and abstract concept but I feel like it's a rather simple idea. I didn't think it was possible but now I'm wondering how I lived without it...

Monday, 2 February 2015

2: Is it a bird? No, is it a plane? No, it's Superclass!

A couple of weeks ago we introduced the concept of superclass and we needed to integrate it into our very first assignment. I had a group of two other programmers and I think we worked together surprisingly well. Together we were able to work through the toughest parts of the assignments and avoid missing small but important details. We had finished our first draft of the assignment with two classes. Luckily, one of our professors mentioned that there should be five and, together,  we were able to make changes to the program on time in order to get the best grade possible. I was satisfied with my part in the group and I felt as though we all contributed a great amount of effort into it. I'm anxious to see what grade we'll receive. In terms of the concept of a superclass, I feel as though I have thoroughly grasped it and demonstrated my knowledge in the first lab we had.