OOP

OOP, as you probably already know, stands for ‘Object Oriented Programming.’ There are a million people better qualified to define it than I am, but here is how I get it: instead of just writing a program that runs from start to finish, you write a series of ‘objects’ which interact.

Of course, I first encountered it in Game Maker, when I thought about making a new kind of strategy game. (Spoiler: I still think it’s a great idea, but am working towards it.) I don’t know how Game Maker works now, but then I understood it like this: you created indiviual objects (figures in the game), gave them a sprite (graphical representation) and coded how they interacted with the user and with each other.

One of the tenents of Game Maker programming was programming objects to respond to ‘events.’ Which basically meant that you’d write a block of code to indicate what that object should do when it, for example, colided with a wall, or was attacked by another object, or whatever.

Ever since then, I’ve been really attracted to the idea of OOP, because it seems to reflect how I think about the world. The world is full of these things (people, objects, devices) and we seem to think we know how they function and interact… so doesn’t that lead to the kind of thinking that we could write an object for everything in the world, code a sort of ‘universe’ for them to all exist in, and simulate reality?

I don’t know why I want to write all this down, except that I’ve been thinking about how coding changed my thinking, and this comes to mind. I know that Python’s support for OOP is one of the things that I really enjoy about it, and, while I worry that I’m not using objects ‘correctly’ (is there a correct way), they really impact the way I think about coding — and the world.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s