Week 3: Object-Oriented Programming
Object-Oriented
Programming is a computer programming technique used widely across computer
science. The focus of this style of programming is an object and this object is
in its most basic form. Different methods are then added to the object in order
for it to upgrade its functionality and make it more complex. For example, we
have an object such as a car. We need methods for the car, such as a method to
drive, stop, reverse, open and lock doors, roll down windows and to turn the
car on and off. All of these methods would fall under the object car. These
functions make up the car. A method that wouldn’t go under the object car would
be to have the car transform into Optimus Prime as this function is not what a car
was basically designed for. Object-Oriented Programming keeps everything much
more organized as it can be seen in the example above. This style of
programming also comes with multiple advantages, such as the reusability of
existing code. Reusability is very useful, the world doesn’t only have one car
on the roads. There are many cars on the roads so the object, car, would be
used millions of times all around the world when required. The code would not
need to be re-written for the car each time we make a new one. We could create objects for anything we want,
such as a clock, traffic lights and automated doors. Object-Oriented
Programming is a powerful tool provided to programmers.
The
tutorials allowed me to bring my python abilities back to par after the
Christmas Break. Not only that, but the tutorials allowed me to put my
knowledge from the lectures to use. I was able to create an Object-Oriented
Program without any problems and make the concept concrete in my head. Although
I had some prior experience with Object-Oriented Programming, the information
presented in the lectures required much more effort in order to understand. This
experience probably gave me about one day’s head start.
I enjoyed the teaching style of
the lecturer, he made sure to give us plenty of examples and went over each
line of code until everyone in the class understood. I feel like my learning
needs have been addressed by the lecturer and I believe, his teaching methods will
help me learn above and beyond what is expected. Despite the ease in which I
learned, there were some concepts I had issues with. The example of raising
exceptions was a little difficult to understand. The part that troubled me the
most was subclasses of exceptions. To solve my issue with exceptions, I plan to
re-read the readings and lecture slides and attempt to trace the exception
example given in lecture. Overall, I feel quite confident about the material
covered in lecture this week, though in my spare time I wish to expand on the knowledge
I was presented with.