TwitterFacebookGitHub

You Down With OOP?

Ya you know me! Much like the song by Naughty by Nature, I am down with Object Oriented Programming. That was a big concept we learned in week 2.

To help explain OOP think of a class called a vehicle describe the minimum things that a vehicle is. For example, ask yourself what you think a vehicle is? You may say things like “Well, like a car or a truck” Now what is the differences between a car and a truck. You may come up with size, the purpose, or other similar things.

Now continue to describe a vehicle, “Oh, well it moves”, “It has an operator, or a driver” etc…

Soon, you know what a Vehicle is and in OOP we would define a vehicle, and for the sake of argument say it can move, and give it a driver of sorts. Then ask, what does a Car have? “Doors, windows etc…”

And then a truck…. “Doors” “windows” “More Wheels!”

Soon, after lots of ideas are come up with, you generally have identified:

1) What constitutes a vehicle

2) What constitutes a car

3) What constitutes a truck

4) What constitutes an air plane.

5) And so on.

This is object oriented programming explained in the most basic way I can think off. Sometimes learning code you get stuck, I shouldn’t say sometimes. It actually happens very very frequently. A little trick that we learned this week is Rubberduck Debugging. What this is, is debug your code by forcing yourself to explain it, line-by-line, to a rubber duck or some other object of your choosing. This makes you break down your code and really understand what is going on. As you can see from the blog image I have a Viking duck named Frode, which is a Nordic name that means “learned, wise”. He is pretty good at helping me figure out my mistakes. I highly recommend you rubber duck debug whenever you get stuck.

This week I have been working on a lot of new projects as well as trying to clean up some of the projects from last week. We started working with grids this week and learned how to save and load files among other things. Things are definitely getting more intricate but luckily for us Origin Code Academy students our teacher is always there to help us out when things look extremely daunting.

Come back next week to see how its going!