Monday, January 20, 2014

Object-Orientated Programming

    In the second week of class, we learnt more about object-orientated programming, and how Python is also a object-orientated language. It is very interesting to see what we are learning now can trace all the way back to 1960s. The difference between object-orientated programming and other programming paradigm is that it focuses on the creation of objects.

    The idea of the object-orientated programming is kind of vague, and thus a bit hard for me to follow. The examples Dr.Heap went through in class were clear, but can definitely be improved. For a while in class, I feel like I don't understand the point of what he was talking about. But the lab last week helped a lot. It made me think a lot, and sort of understood what the prof was talking about in class. However, I still don't feel very confident about the material covered last week, and I looked at the slides from class, but it did not help as much as I expected.     I think the amount of people in the 10 am lecture also bothered me a lot. I was registered in the lecture, and whenever I got to the lecture hall right on time, there were never enough seats for everyone in class. There were people from other sections coming to the lectures, and it was very disturbing. I had to stand at the very back and it was really hard to focus. I hope that people can just go to the sections that they signed up for so that things can be easier for everyone.
    

    The exercise was quite easy for me. I feel like the materials covered in the exercise are more or less from CSC108, and it was more of a review than understanding the materials about object-orientated programming.
     

    Object Oriented Programming is a programing style that represents data and theoretical concepts as "objects" and the corresponding operations on the "objects" as "methods". During the initialization of an "object", "attributes" will be attached to the object defined. In computer science, object oriented programming can greatly simplify practical tasks by attaching a finite subset of functions to a specific type. This way, computer scientists can freely choose among different existing types and have the flexibility of creating classes of their own based on the demands of their tasks. With object oriented programming, the implementation of Abstract Data types are also greatly simplified since it is only the analogue of creating a class. Object Orientated Programming can also help programmer to understand GUI in a more intuitive way. For instance, the creation of a space in tkinter is simply the class Canvas. The appearance of a rectangle on the screen is simply the implementation of the create_rectangle method to the Canvas class.

No comments:

Post a Comment