Thursday, February 12, 2015

Object-Oriented Programming

Yet another week of hard work has ended. The good news is that next week is reading week.

For the past few weeks, most of our tutorials and lectures are focus on object-oriented programming. From a point of view of a student who has not touched a lot of programming and computer science before university, I can honestly say that I have learned at lot in the past weeks. Although I have touched a bit of object-oriented programming in CSC108, it is not enough for me to get through this course with just that. Some new concepts that was covered was knowing how to translate the question description into code. This part I struggle a bit at first in the beginning of the course, but as I move on to do more questions, I starts to get better at it. Also, we also learned how to write special methods for class such as __init__, __eq__, __str__, __repr__ and __contains__. Some of these special methods I learned in CSC108, so I had no problems writing them, though some of them I have know learn and understand such as __repr__ because when it was first shown to me, I did not know what is the use for __repr__. There is also something else that I found to be really important, which is know what to implement in the parent class and its children class. I have honestly say that in the process of writing assignment 1, I struggled quite a lot in deciding what to put in the parent class and its child class. Often times I would ask myself "what is the point of writing a generic class I could write most of them in one class". Later I understood that, writing a parent class makes it easier or more faster in implementing a new subclass for that superclass, since a parent class would contain everything a generic subclass would need, so I won't have to repeat everything if I have to write a similar class. Though object-oriented programming is essential, I found recursion to be more interesting. I cannot wait to learn more about recursion.

See you in a week.

Friday, February 6, 2015

Week #5 (Feb. 2 - 6)

This concludes the most busy week yet, since I’ve been back. As I mention in the previous SLOG, everything is due this week and there is many test from my other courses also occurring this week. Some of them include Introduction to Psychology and Introduction to Italian. But the most important thing happening this week is the CSC148 term test 1. From what I can recall, the test was quite doable. Most of the questions on the test was quite straight forward, that is after I read them a few times over. However, one of the question on the test I felt that I didn't fully understood what the question was asking, which could also meant that I did the question incorrectly. But for the most part, I believe that I did the questions correctly. 

On the other hand, in lecture, we covered a bit more in recursion this week. We looked through a sorting algorithm; quick sort which it used recursion as a part of its code. When I was first shown the code, maybe I wasn’t paying much attention but I didn't completely understood the algorithm of quick sort. Thus, when I was showed the code, I couldn’t really trace the code and get an understanding of what the code should do. Maybe that is what I should look through over the weekend. Other than that, we also talk a bit over testing via doctests, unit-tests and more into stack.

During tutorial, I was able to go through all of the assigned tutorial problems and implemented them correctly. We implemented the class Queue and saw though it is structurally the same as Stack but it is different in how it returns the items from the data list. Even though that there is some question that I could not quite get at first, the TA helped a lot in clearing those misunderstandings. The quiz later went good as well. What we were quizzed on what the code list_queue which we implemented earlier. Since, I was able to implement the function before the quiz started, I was quite confident in the quiz when I saw it. At the end, everything during the quiz went well.


Next week will be the last week before the break, I am hoping to get through it with ease. 

Sunday, February 1, 2015

Week #4 (Jan. 26 - 30)

The first few weeks of school had been quite hectic, I am glad to be back again. Soon after it will again be midterm season, and things will start to get busy. That is if it had not been busy already. Entering CSC148 things don't feel quite the same as it was in CSC108. For instance, in CSC148 we are asked to identify nouns and adjectives from the class description and write a class from scratch from that. Unlike in CSC108 we were given the complete description of the function that we were suppose to write. That is something that I don't like but necessary in the future of my computer science studies.

In the first week, we were given our first assignment. The goal of the assignment was to write implement a series of classes and methods. We were given the task to create a game for subtract square. To be honest, in the beginning I was struggling with the assignment. The reason is that I felt that the assignment was quite unclear and I did not know where and how to begin. But after reading the assignment a few times over, I start to have an idea of how the game is going to be. After getting an idea, the implementation part to me was quite successful. Although at the end there are some features that I didn’t have time to implement but overall, I felt that the assignment was a challenge for me to think and write code just from scratch.

Another new concept that I found to be really interesting was the concept of recursion. The idea of have a function that calls on itself to complete a computation to me was quite mind-blowing. During the tutorial, I was quite successful in tracing the recursion codes, but the last part of implementing a recursion code myself was quite difficult. I’ll admit that I took some time to complete that. But overall, I cannot wait for write some codes involving recursion myself.


 The first few tutorials of this course went okay, my friend and I was able to complete the labs assigned and did well on the quiz. What I found to be mind-triggering was the first few tutorial quiz questions. Somehow I felt that the question during my tutorial time was somewhat unclear. I was having trouble determining what I have to write for quiz. Fortunately, I was able to found out what I suppose to do in the end. Anyways, next weeks will be a very busy week as I mentioned before because of midterms and papers due, hopefully I will be able to manage all of that. Looking forward to a good week next week.