Object oriented programming was, as mentioned before, not too difficult to pick up and play with - probably because I had previous experience with such a topic. My first 'real' encounter with object-oriented programming was in Grade 10, when I self-taught myself Java, which, in all due respects, an object-oriented language. After a few lessons, the concept of object-oriented programming was no big deal and I immediately could understand the purpose of it all (whereas initially, using Python, I could not grasp the concept - and this was in Grade 9).
We started off by understanding what an object was in computer programming; simply put, a virtual instance of a real-world object. We covered ways to implement it - such as reading a description and manually picking out proper 'verbs' (which would be translated to methods) and 'data' (which would be translated to the object attributes) found in each object's description. For example, if we were given the description of a car below:
"A car can keep track of the amount of gas remaining, its total mileage, and number of passengers; furthermore we can use a car to drive n miles, add/remove passengers, or get a new paint job."
We could immediately say that the Car object would include data values for amount of gas remaining, total mileage, and passengers; its methods would be to drive, add/remove people and change color.
When it came to implementing the actual Python code, it was not too difficult; for the most part the code would consist of writing methods, variables and logical statements - things that we have, and should be familiar with from previous programming experience or CSC108. All in all, the first few weeks of CSC148 were simple enough to comprehend via oneself, or the lecturers/TAs in class.
No comments:
Post a Comment