Back before I started programming, I used to think that programmers would write very long lines of code to create their programs. Old me used to believe that the people who make video games have thousands and thousands of lines that make the game. Well, a part of this is true. There ARE many lines of code that make up games. However, as my old self would have believed, they are not all on the same file.
Before I knew what object oriented programming was, I thought that all methods, functions and systems all fit into one file and class. Oh boy, was I so wrong. I am very glad to be wrong, too. If programming like this were the case, I would've given up ages ago. Thanks to the genius that is creating classes and subclasses that work with each other, I am able to create elaborate projects piece by piece. I do not have to focus entirely on the whole picture and instead concentrate on what a certain part of the program does and how to implement it.
How easy is it that I can create a separate file for a subclass of a computer strategy system? I do not have to mesh a bunch of different strategies in the same file but instead I can organize each different strategy in a subclass that is separate from the rest. It makes thinking about computer strategies a whole lot easier. Through object oriented programming, I can mark common features of each specific strategy and implement that in the parent class. Then I can put specific traits of each unique strategy in a subclass. These two classes would then work together to implement said strategy in a game. This kind of orientation of codes ensures that I have an organized setup that I can easily analyze and fix later on.
It may seem like such a simple concept but without it our lives would be a whole lot more difficult. Via object oriented programming, I am one step closer to becoming a master programmer. Well, at least I will have the organization skills of one.
No comments:
Post a Comment