Sunday, 15 February 2015

Week 6 -- Impression on Object Oriented Programming

     This semester started with introducing object oriented programming in python. However, I couldn't quiet understand the concept until we started designing and implementing our own classes.
   
     My first challenge was understanding 'object' in python. From my prior knowledge taking CSC108, I understood there are different types of built-in classes in python such as int, str, list, and it's quiet reasonable to consider them to be objects. However, they are not the only type of objects in python. In fact, I was soon adapted to the idea that everything in python can be considered as objects.

    Everything in python is an object and the class tool we use is like a function that generates objects of a particular kind, which is called the 'instance' of this class. The object generated by this particular class can contain not only data, but also functions that could be applied to it. To be more precise, the instance has both attributes and methods. When we define our own class, we must first decide what we want to be kept as data, and what methods we wish to design for those instances of this class.

Next, I would like to talk about my understanding in the relationship between oriented objects


The objects in python. group together data and functions inside the data.



Sunday, 8 February 2015

Week 5 -- Impression of Tracing Recursion from Week 4

In week 4 we studied some recursive functions, traced them and tried to design our own recursive functions. Personally I feel tracing recursive functions isn't hard. All we need is the ability to read the functions. Tracing it is simply plugging the arguments into the recursive function, and step by step write down the output. Just after a seeing a few examples and doing some practice exercises I was quiet adapted and rarely make mistakes.
However, tracing is of course very easy compared to actually designing a recursive function. In the end of lab#4 their were some exercises on designing our own recursive functions. It felt much more challenging. I felt it is very important to think systematically when designing such functions. The functions we ran into generally break the problem into two parts--the "if isinstance(a, b) " statement is used when the parts in the arguments needs to be plugged into the function and go into recursion; the "else" statement is usually when the some parts of the argument needs no more recursions. and after some slight modification (such as adding 2 to the number or 'ox' to a string), will be stored in a list as part of the output. So when designing recursive functions, we must decide when the function should keep on taking arguments inside arguments ; what kind of value reached would no longer need to run the recursive function, and what should we do to these values to give the correct final output. 

Sunday, 1 February 2015

Impression of first few weeks

For the first few weeks of the semester, I did not have a good start as I didn't recover from my holiday   laziness and get back to the fast school pace. Especially in the first two weeks. The lectures were very   crowded at that time and I sat in the very back, my mind basically wandering around for the whole lecture. So I wasn't efficient in class, nor was I spending enough time to review the material and prepare for labs. So I did pretty bad on designing and implementing classes. I do feel I was having a better understanding for recursions and I did pretty well on the lab and quiz and I could finally sit down and actually study the material for couple of hours. However, I am still a little unorganized and  inefficient in lectures.  

Personally I feel this course requires more effort than CSC108 . 108 is an introduction course, with pieces of information on objects, functions, loops etc. But 148 is giving me a more coherent feel as we start  to explore how everything we learned in python are related and how we can reach our own goals using presented tools and acquired skills. Particularly, we are going deeper on the same subjects. Therefore, this course has quite a bigger workload--not in terms of the topics covered since we only talked about class and recursions but in the depth we went. When studying 108, I felt like as long as I go over all the lecture videos and course notes I would be fine since everything we need to know were covered in those. However for 148 the lectures were more like an exposure to knew concepts, and we need to read the notes and additional material to improve our understanding. When I looked over the additional questions on the lab sheet for recursions, I realize the difficulty in designing such functions on my own. Only knowing the concepts just isn't enough. We have to go through a process of practising and understanding.

This is impression for the course for the first few weeks. For the upcoming weeks, I hope to be more organized and dedicated. Wish everybody good luck!