I understand that CSC148 is a follow up to CSC108, which teaches basic programming. For the first weeks of class, it was clear that we students were being hammered on the importance of object-oriented programming. We spent a lot of lectures focusing on building and designing a class properly. For example, we were taught to choose the appropriate names for our attributes and methods. We also spent time on designing special methods such as __init__, __eq__, __str__ and __repr__ which I only found out about in this course. Learning about the built in function property() was also pretty amazing. It allowed get/set methods just like in Java or C#.
In talking about object-oriented programming, another neat feature we learned about is the concept of inheritance. Initially, I thought setting up classes with all its special methods was a a lot of work, and quite impractical. However, I guess all that work paid off when we created sub-classes which inherited the methods and attributes of the super-class.
Overall, this idea of classes and sub-classes all interacting with each other in a program is quite fascinating. I got to experience that first hand in completing Assignment 1. I hope to learn more in the weeks to come!
No comments:
Post a Comment