2015年3月10日星期二

Week 7: After Break - More Recursion and Binary Trees

After the reading week, I feel myself a little bit less productiviy. It is probably because I didn't practice and study during the reading week at all, though that was a result of some troubles. All in all, I have learnt a lesson from this and will work harder during the vacations in the future.

Back to the topics, during week 7 Prof Heap introduces us the idea of binary tree. It seems to be simpler than the genral Tree class, as it has some particular properties, such as each internal node should have no more than two chidren. And the Binary Search Tree is even more identical, with comparable data in a increasing order as left subtree < node <right subtree. However, it is useful. It is right because we have these properties, we could write more helpful methods and funcitons with them. For instance, when searching a number inside BST, we don't necessarily check evey node. In the worst case, we can check up to half of the nodes only. I believe there is more fun waiting ahead.

Also, I start working on Assignment 2 as Prof Heap suggests. It seems to be more complicated than A1 whereas it might even be less actual coding works. I think the idea behind constrcuting new game type and epspecially the new strategy is the key.

2015年2月28日星期六

Week 7: Week 6 Blog to be Graded

Please grade my week 6 blog as in the following link:
http://lanbopeicsc148.blogspot.ca/2015/02/week-6-object-oriented-programming.html

2015年2月23日星期一

Week 6: Object-Oriented Programming

To be honest, I am really not good at summary of concepts and ideas. Moreover, I only have a vague understanding about what Object-Oriented Programming is. However, based on what I have been working on through these few weeks, the building of data structure, such as a class, and the fucntions that data structure can work with, which is called the methods, is usually a pretty clear task. As far as a programmer has a complete plan of what the required information and the form of manipulating and modifying on it, the process of actually writing the codes is not hard anymore. Therefore, the most important thing is to make it clear to oneself that what the expected product is, before actually start to program.

Consequently, it is important to think in the way that computers do. Do it frequently while you are writing the codes help you find some flaws you do not notice before and bring you better codes that reach your goal. In short, keep asking yourself what you want and do the codes you have written reach it. For instance, when building a __init__ method for a class, I always ask myself "What are the necessary property of this class? What does this class mean?" and this will lead me to the constructions of the attributes. Then it becomes a problem of what the cases the class instances are expected to deal with, which will make other methods.

Eventually, you will have codes that reach your expectation, but there are still things to do. After making sure there is no more bugs, ones can always think about how they can improve their codes. Some good questions are, what lines of the codes are possible to be repalced by shorter codes? What kind of change or new codes will make the program not only reach the goal but also cover more unexpected situations? There are always place to develop.

2015年2月11日星期三

Week 5: Recursion

Before talking about recursion, I would like to record something about the term test 1. It reveals that I am not familiar with the materials included because I almost fail to finish the test in time. Also, I made a mistake which was forgot to use the super class' name in the __init__ method.

The recursion functions are pretty interesting. Before that I hardly think about functions that include themselves in the body. However, I did have some learning experience of this type of function and the way to think and trace it when taking CSC165 last term, so that I feel quite confident on mastering the material. I can clearly trace what a given function does and write a function that runs as the expectation.

2015年2月3日星期二

Week 4: Assignment 4 Due

I have to say that Assignment 4 is composed to be a really good exercise on what we have learnt so far.

In fact, after the lectures and the regular labs, I was still unfamiliar with some certain problem. For example, I just found the right way to write __repr__ method of a class/subclass after I did the relative works in A1. Before that, I only had a vague idea of what it was and sometimes could not tell the difference between __str__ and it.

However, I have much to improve as well. One of the critical problem I have had for a long term is, I am not organized enough to leave appropriate time for the assignments. As a result, I just rushed A1 before its deadline and there were some incompleteness in it. I would have done it better if I planned well.

Therefore, the next goal is being organized, planned and prepared with the process of finishing works in addition to being good at the knowledge.

Week 3: Why Geeks Should Write

First of all, I am very sorry about the fact that I have not posted anything until now. To be honestly, I am not used to write things, especially this blog-ish kind. Therefore, I did not put much attention on this and totally forgot writing this while I was busy preparing some tests and quizs.

However, what happens on me might be a very good explanation of why computer scientists, or so-called Geeks, should keep logs as well as other writings.

Above all, I do not feel uncomfortable with the term Geek. It used to have a rather negative connotation in the past, but now I believe that is not the case anymore.

Nonetheless, there are certainly some properties that most Geeks probably share. As described above, I am definitly not good at writing and somehow not organized. This is one of the symptoms of "Geeks are not good at social communication". Nowadays, that may not be right anymore, but there are reasons why this would become a typical symbolism of Geeks. Another case is, as a computer science studnet, I am interested in codes more than words, in other words, more interests in "computer language" than "human language".

But this doesn't effect the fact that writing is important to Geeks also. Other than the social communication need of us as a human being, human writing style works as an easier way of recording infomation. Using codes helps us understand the way computer works more, but when it comes to conclusion and recording, it will never surpass the human way of thinking. After all, we are human beings so we have more privileges when we use our own way to think sometimes.

That is what I understand and conclude so far after reading a couple of articles about how logs are important computer scientists, particularly related to debugging field. Therefore, I will try to catch up and get used to do this, in order to be good enough to call myself Geek, a term that I will be proud of.