Throughout the course of CSC148, object-oriented programming
has been the major theme. Most of codes showed in class or we need to write are
based on object-oriented programming. This can be clearly seen in both
assignment 1 and assignment 2 as object-oriented programming is a crucial requirement
for those two tasks. The diversity of object-oriented programming is
significant but the one type that this course is focusing on is class-based ,
creating new classes and it’s subclasses for different objects. I learned about
this class-based coding a little bit in CSC108 but here in CSC148, I am able to
fully understand why classes are so essential to coding.
At the first 2 weeks of the course, I was having trouble
understanding why classes and subclasses are emphasize in the course as I feel
it’s a waste of time by making more python files for different classes. However
I now understand that classes are kind of like folders where it groups and
organizes similar stuff together. Although I feel this is sort of irrelevant at
this stage of my personal coding as my programs are not that sophisticated but
I can definitely see how this type of object-oriented programming can be really
helpful with a complex program. The way that there is a general parent class
that can be really simple but its subclasses have detail coding that follow the
parent class closely so all the subclasses are very similar. The inheritance
feature of classes is the magic of object-oriented programing where all the
subclasses can inherit all the functions from the parent class but it also let
the user to override these inherited functions if needed, this is essential as it still let subclasses
to be grouped under its parent class without losing much flexibility when
modifying the codes.
Although the organization and grouping that classed-based
coding brings is really helpful but I still find that it could be tedious and
time consuming to write all codes in this format. At least for the level of
programs I am writing right now for this course, I feel like object-oriented
programming is unnecessary as the codes do not need new instances or subclasses
to make it neater. This means that at this point I feel like object-oriented
programming is less efficient for me then regular programming or at least
subclasses can be ignored but still be able to complete a program that works as
intended.
No comments:
Post a Comment