Wednesday 22 January 2014

Introduction and Object Oreinted Programming

Hello, and welcome to my blog about CSC148! I'll be posting weekly updates talking about the material we've been covering in class. I'll start off with some background information, I have taken three high school computer science courses where I learned how to program in c++ and python, I also did some programming contests and really enjoyed learning new things about computer science. I really enjoy thinking about challenging programming problems, so I am looking forward to the new concepts we'll be learning in CSC148.

In high school I learned a lot of the basics involved in object oriented programming such as creating classes, and some use of inheritance. Over the past couple of weeks we have been discussing some ideas involved in object oriented programming. We first talked about the basics of class construction, and have since been learning more specialized ways to enhance these classes. One of the tricks we have learned is a good way to cut down on duplicate code called inheritance. By inheriting from another class you can utilize all the functionality of that class and alter it without changing the original, this can become useful for specializing classes to perform more specific functions without altering the existing class.

More recently we have been learning about ways to enhance basic class objects to become more useful to the user and more integrative into python. One of said techniques is raising your own exceptions. In CSC108 we touched lightly on the subject but never really went in-depth about its uses. I think creating your own exceptions could be very useful, especially when working on a group project. It seems like a great way to reduce the likelihood of people who didn't write a class to get a better grasp on how to use it correctly. We also learned about the __eq__ and __repr__ methods. In csc148 we learned about the __eq__ method so it was nothing new to me. However the __repr__ method was something I haven't seen before. It seems like an incredibly useful method for expressing a data type to a user in a comprehensible way.

So far this course has been very fun and interesting, Danny seems interested in the class material so I'm sure the rest of the course will be even more exciting.