Week 3: Object-Oriented Programming
Object-Oriented Programming (OOP) make codes easier to understand because of its structure and it is also very easy to expand your code and make it efficient because of how classes work, with inheritance (subclasses) the code can easily be further evolved and be efficient at the same because it can use methods from the parent class or expand them. CSC108 from last semester somewhat introduced the concept of Object-Oriented Programming because we were taught the basic concepts of making our own classes in python. I feel like CSC148 went more in depth about the properties of a class and fully understanding a class rather than just knowing how to make a new class. The concept wasn't very hard to grasp as I have little previous experience in Java and CSC108 did introduce me to the basic concepts. The lab#2 was also very helpful in further solidifying my understanding of classes and OOP because we had to write a class and compare it to a similar existing one (Stack and Queue).
The syntax of the parameters (type contract) confused me a bit in the beginning because were taught a different way in CSC108. I feel like the PEP3107 syntax for the parameters is better because it actually type checks the method unlike in CSC108 where you just put it in the docstring. I don't really understand why CSC108 was taught a different way for writing the type contracts. Also there's another way of writing a list in a loop which wasn't taught in CSC108 which was [function(x) for x in list] which I found very cool because it looked very neat and organized as it's only in one line. The two new ways/syntax of writing code was hard to adjust to at first especially when reading a code. I tried writing my own simple codes to familiarize myself with the syntax and as I wrote more and more codes/methods I was able to adapt to it.
Overall, most of the material in the first three weeks were very straightforward and wasn't difficult to understand with the exception of maybe recursions and exceptions. The concepts are somewhat tricky or difficult to understand at first but I may just need to write some examples or do problems involving them to fully understand them.
Overall, most of the material in the first three weeks were very straightforward and wasn't difficult to understand with the exception of maybe recursions and exceptions. The concepts are somewhat tricky or difficult to understand at first but I may just need to write some examples or do problems involving them to fully understand them.
No comments:
Post a Comment