From the standpoint of a non-programmer or even a beginner programmer, the concept of objects and inheritance is by far one of the most confusing things to understand in computer science. We were all there at one point; we all had our struggles with objects and what they were even used for. Personally, I struggled with the entire concept of instances of objects and how they were completely separate from one another, or even how all these methods and attributes worked together. I remember my high school computer science teacher explaining how Windows essentially started the OO (object oriented) revolution, and how "every window you see on your computer looks the same because it inherits from the 'cosmic super-class'". Although most people at the time did not understand what he was talking about, that single statement really does sum up OO programming. Essentially the vague term 'object' is just a way of representing some code that is being re-used, and is basically just a synonym for 'block of code'. Of course there are some rules about what qualifies something as on object, but that is the general idea behind it. The confusing part is when you are first told that you can have as many objects as you want and that they are all independent from each other, despite using the exact same code. Then of course there is the usual bombardment of language where every object is an instance of the original code (i.e. it is an identical copy), which through the process of instantiation gets added to a stack and.........
Basically things are made unnecessarily ambiguous and too many rules are thrown at people right out of the gate. Although I would argue that Python is the easiest OO programming language to learn, it still has its fair share of difficulties. To correct some of the other students' SLOGS, HTML and CSS are not object oriented languages because they are not object based; they are markup languages and you cannot create objects in them. Python with its essentially 'wild-west' book of rules makes it incredibly easy to create and manipulate objects (in comparison to a language like Java or C++ where rules are very strictly defined). In Python you can randomly add methods to your objects after they have been executed, you can modify any variable you can get your hands on etc., but at the end of the day, Python is still a very solid and very capable language to program in. OO programming is one of the most useful pieces of programming we have at our disposal and it is essentially what computers are built upon. Lectures have been useful in showing us how Python deals with inheritance and there has been plenty of examples to show how it is used. For a programmer, inheritance really is the greatest thing since sliced bread as it allows us to only write code once but reuse it countless times. It is really useful and the professors are very good and clearing up this initially confusing topic. We've had lots of practice with OO programming so far, and I bet it is here to stay.
No comments:
Post a Comment