Tuesday, February 24, 2015

Abstract Data Types (ADT)

Abstract Data Types are a really cool concept. I like the idea of making a generic class with all the properties that a subclass may require and then in the subclass you can always override the implementation and customize it to what's needed. This helps making code modular and adding stuff gets a lot easier.

I can imagine this being good for applications that have many objects that are all similar but slightly different. I think of a game for example. All enemies in the game have some common properties such as an x and y coordinates and maybe health but they would all have a different special ability so that feature would be implemented in the child class while the other properties like coordinates and health only need to be implemented once in the parent class. If you want to enforce that all enemies have a special ability you can always add the special ability function to the super class but throw a NotImplemented error and that way there can be no objects of the super class but you would have to make a child class and override the special ability method otherwise when that method is called it will give an error.

This helps with making code modular because now if I want to add a new enemy I do not need to edit the super class, I can simply extend it and make whatever I want.

Overall I think ADT are one of the most useful concepts when combined with other OOP concepts like inheritance and using ADT can really make a difference in how well designed the structure of a program is.

Tuesday, February 10, 2015

Object Oriented Programming

Finally! I was really looking forward to the object oriented stuff in this course. I am pretty familiar with the concepts of OOP and I was looking forward to covering the concepts in this course since OOP is so useful. I'm glad we've covered all that stuff so I can start using concepts like inheritance and abstract classes. Hopefully my code starts to be a bit more organized and more modular with these new things.

Inheritance is something I use a lot in my own personal projects so it was weird going back to programming and not using it in the first few weeks of this course since it is so useful and the way I design my classes usually rely on it.

Recursion is getting a bit more tough with some of the tree stuff we've been using but I can definitely see the application now since loops would be tough to use for trees and definitely slower.

Friday, February 6, 2015

Tracing recursion

Recursion was a really interesting topic to learn. It can get really confusing so the strategies we learned such as tracing the function calls was really helpful. Recursion right now seems like more trouble than its worth in the implementation however. Maybe because I have never used it much in the past and gotten by without it I prefer to use simpler ways but I am hoping we get to see really cool implementations of it.

Assignment 1 was pretty interesting to do. I have made games before but I've never used the whole 'GameState' practice to make them so it was tough getting myself used to thinking with that implementation but I am pretty confident I did well enough. It wasn't as difficult as I thought it would be when I first read the requirements so I hope that I am doing well enough in the course and that's the reason I am able to do it with ease but I am sure my previous experience programming helped as well.