Generalization can be tricky, thinking at a higher level, as opposed to one specific example, is something that we've been having to learn as we realize that we can create programs that can help solve many instances of different, but similar problems. One of the types of ADT's we've talked about in length is stacks.
Stacks are pretty nifty as they will only allow items to be placed on the top and removed from the top, which can be very useful for a variety of problems one will encounter in their computer science career. Some real world examples would include: tracking functions calls, or even tracking visited pages in google chrome or firefox.
The most important thing to note when talking about ADT's is that if you're looking to create one, DONT FOR THE LOVE OF GOD focus on the details, but focus on, what can I do with this stack? How can I use it to the best of my advantage and for what kinds of problems? Because by not worrying about the details, you could then implement your stack or other ADT in a different language. Though I don't see the immediate benefit, I'm sure as I progress, I will learn and appreciate these little nuggets of abstraction more and more.
I mean, look at Trees. We've just begun to dive into their functions, but I can already tell that these will become very useful for future projects and have a very large potential for possible future problems that we will encounter in this course as well as in the future.
Monday, February 23, 2015
Friday, February 13, 2015
WEEK 6 - OOP 's
Object oriented programming was something introduced at the end of CSC108 that I thought would be relatively unimportant and kind of silly to use.
WOW WAS I WRONG. I NOW SEE THE LIGHT.
Thus far in the course, it has been solely coding using object oriented design. We've been working with classes and subclasses, learning how inheritance works and learning about overwriting methods, its great! The whole concept behind having a parent class that is super general, and then having sub-classes that are specific to a problem is a concept I really had a hard time with. This was brought up in A1 where we had to write the general and specific for our game. Having gone through the game, and now more examples, I can see how crazy useful it is to have this parent/child set-up. It makes adding functionality a breeze and really brings to life Diane's analogy of the pop-machine.
I think back on our assignments we completed in 108 and I wonder how quickly we could complete them with the use of classes and OOP as opposed to the very tedious and slow methods we used back then.
My favourite thing thus far has been the creation of special methods and being able to call on whichever you've created and see it come to life in the shell! I did have some confusion though with the difference between methods and functions and when to use one or the other. I've resolved this problem as I really make an effort in naming all my classes, methods, descriptions, initializers effectively. I know a lot of people scoff at the instructor when they repeat: "Choose good names" or "Draw out diagrams". But I swear, doing so will make anyone's life so much easier and in the long run will be very beneficial later down the road. I will say that after having completed the assignment I feel much more confident in these areas, and I think I succeeded very well in the term test we had last week which featured a lot of these Object Oriented Programming topics. I will look forward to seeing how we can expand on this kind of programming throughout the semester and within future courses.
Leo out
WOW WAS I WRONG. I NOW SEE THE LIGHT.
Thus far in the course, it has been solely coding using object oriented design. We've been working with classes and subclasses, learning how inheritance works and learning about overwriting methods, its great! The whole concept behind having a parent class that is super general, and then having sub-classes that are specific to a problem is a concept I really had a hard time with. This was brought up in A1 where we had to write the general and specific for our game. Having gone through the game, and now more examples, I can see how crazy useful it is to have this parent/child set-up. It makes adding functionality a breeze and really brings to life Diane's analogy of the pop-machine.
I think back on our assignments we completed in 108 and I wonder how quickly we could complete them with the use of classes and OOP as opposed to the very tedious and slow methods we used back then.
My favourite thing thus far has been the creation of special methods and being able to call on whichever you've created and see it come to life in the shell! I did have some confusion though with the difference between methods and functions and when to use one or the other. I've resolved this problem as I really make an effort in naming all my classes, methods, descriptions, initializers effectively. I know a lot of people scoff at the instructor when they repeat: "Choose good names" or "Draw out diagrams". But I swear, doing so will make anyone's life so much easier and in the long run will be very beneficial later down the road. I will say that after having completed the assignment I feel much more confident in these areas, and I think I succeeded very well in the term test we had last week which featured a lot of these Object Oriented Programming topics. I will look forward to seeing how we can expand on this kind of programming throughout the semester and within future courses.
Leo out
Wednesday, February 4, 2015
WEEK 5 - RECURCEPTION?
Confidence level: plummeting...
Here I thought this course wasn't going to throw me any curve balls. Well, I just got a fast-pitch and it goes by the name of recursion. By far the most confusing and hair pulling concept.
I can tell that this can get really confusing quickly, as this week we started off slowly by tracing recursive functions. Recursive functions, mean functions who call upon themselves, as you already knew. This was an interesting concept to grasp and definitely something Christopher Nolan created to mess with your brain for the remainder of existence.
I'm glad that we are starting out slowly by first tracing the code, because I can assume that as we progress, writing recursive functions will become nothing but challenging and very confusing. It's definitely a different way to think about functions. I think that by tracing more and more examples of code, focusing more on the actual body and less on the docstring will be the most effective way for me to improve on my recursive thinking and understanding. I can definitely see where the ability to use recursion will come in handy throughout future tasks and I am a bit intrigued but also scared to see the problems we will have to solve using these techniques. I can see recursion becoming very complicated quickly, and so I think that by practicing tracing repeatedly will help build my confidence level and hopeful this will translate into a mastery of the topic as the semester progresses.
I'm going to do the additional exercises and hopefully something will click, and fast!
I can tell that this can get really confusing quickly, as this week we started off slowly by tracing recursive functions. Recursive functions, mean functions who call upon themselves, as you already knew. This was an interesting concept to grasp and definitely something Christopher Nolan created to mess with your brain for the remainder of existence.
I'm glad that we are starting out slowly by first tracing the code, because I can assume that as we progress, writing recursive functions will become nothing but challenging and very confusing. It's definitely a different way to think about functions. I think that by tracing more and more examples of code, focusing more on the actual body and less on the docstring will be the most effective way for me to improve on my recursive thinking and understanding. I can definitely see where the ability to use recursion will come in handy throughout future tasks and I am a bit intrigued but also scared to see the problems we will have to solve using these techniques. I can see recursion becoming very complicated quickly, and so I think that by practicing tracing repeatedly will help build my confidence level and hopeful this will translate into a mastery of the topic as the semester progresses.
I'm going to do the additional exercises and hopefully something will click, and fast!
Until next week,
Leo ouut..
Subscribe to:
Posts (Atom)