It's been a month and a half since this term started and, really, university life moves fast. The past week we've been talking about the green good stuff. Yes, I'm talking about the ADT Trees. At this moment, I still can't wrap my ahead around how the tree looks like in actual data(lists), instead of the visualization of a tree, with nodes and leafs. I hope I will figure this out during lecture.
Now, time for some more good stuff, Object Orientated Programming. Back in CSC108 and even back in high school, Most of the stuff I did that was mostly with lines of code to make a 'program'. For example, functions or having an entire program in the __main__. The one time I had some experience with OOP was when we used visual basic, since literally, everything was an 'object'. As well, in 108, most of the course was around building functions with the final 2 - 3 weeks being about classes and methods. As I said in one of my earlier posts, I said that we never went that in-depth into classes in 108, then suddenly in 148, CLASSES, SUBCLASS. It was definitely a good thing since having a whole program in __main__ would make debugging and understanding a nightmare. We've learn to initialize and create a class properly and in the most wrong-est way possible. We learnt what a method is, in general, a function that is within a class. Some methods are a bit hard to create depending on the class (ex. repr and str). We learnt about inheritance with classes, as in subclasses, then there's subclasses of subclasses. I mean we did have an entire assignment based on subclasses. Other than that, it's been ADTs throughout the weeks that have past.
Sunday, February 15, 2015
Sunday, February 8, 2015
To understand recursion, you must understand recursion.
Recursion has so far been fairly understandable. The whole concept of constantly recalling the same method on every element of a list is not something that is 'that' hard to grasp on, what can get confusing is when the information we are trying to get is either non-accumulative in terms of the elements of the list or requires comparing different elements of the list. For example, during the tutorial, the question asked us to write a method that would compare the lengths of each list and inner list and return the longest list. I had a hard time figuring out how to retrieve the lens of the strings without overwriting the number in the next iteration. I think I still have a ways to go.
On a side note, this week's midterm went pretty well. I felt like I did pretty well, while the only problem I had was remembering what the type contract was when in __eq__, what to assign to 'other'. As for the length of the midterm itself, it took quite a while, mostly because I spent a lot of time rewriting the name of classes when called but i wouldn't consider it too long. Others said they were pressed for time.
As for this week, we did more ADT in tutorial. It didn't take long to understand even though we only had a fraction of a lecture to do it. Interestingly enough, queues are basically recursion. What I did question was that once you got to an inner list, and was told to break apart that list and re-add the elements of said list back into the queue, the definition of the puts those elements at the back of the queue, rather than at the front. Is this correct or do we need to change it so that it re-adds at the front?
Sunday, February 1, 2015
So far down in __main__
Having come from CSC108, I was fairly confident in my programming skills yet I was smacked in the face with classes as soon as CSC148 started. It was a bit puzzling yet I'm not completely surprised as the course description clearly said to take 148 only if you had good programming experience before hand. The first few weeks went by relatively smoothly, mostly being reviewing all the stuff I've forgotten from 108 while building on with sub-classes. We never did 'that' much about classes in 108 so I thought this was useful. Tutorials were helpful as well, just like how we had our weekly Prepares, etc, back in 108. Being forced to constantly work on material helps me keep up with the class because I am in no way considers 'ahead' of anyone else.
Then suddenly at the end of the first week, the first assignment was posted. 'I guess this is university.' The first assignment was a nightmare. I could say that it was partially 108's fault because every assignment was basically: Here are all the methods we want you to make. Here are examples. If you want to add anything, go ahead, now go. The spoon-feeding made it hard to understand what the assignment required of us. What made it worse was that the assignment was left 'general' for us, so we could express our own coding style yet the irony was that there was still specific requirements such as having specific classes and sub-classes and how they 'should' work with one another. It took me more time figuring out what classes we needed and what they were supposed to do. Our in-class Q&As was some-what helpful but it took until the day before it was due to finally receive a proper rundown of what we needed but still, to the end, I could not implement game_view class properly.
Lastly we started recursion which was completely new to me. So far I'm understanding most of the basic examples with the more complex examples being more of a 50/50. I did had a bit of a hard time with the tutorial question since I couldn't figure out how to keep the length of a list without overwriting it with the next iteration.
Then suddenly at the end of the first week, the first assignment was posted. 'I guess this is university.' The first assignment was a nightmare. I could say that it was partially 108's fault because every assignment was basically: Here are all the methods we want you to make. Here are examples. If you want to add anything, go ahead, now go. The spoon-feeding made it hard to understand what the assignment required of us. What made it worse was that the assignment was left 'general' for us, so we could express our own coding style yet the irony was that there was still specific requirements such as having specific classes and sub-classes and how they 'should' work with one another. It took me more time figuring out what classes we needed and what they were supposed to do. Our in-class Q&As was some-what helpful but it took until the day before it was due to finally receive a proper rundown of what we needed but still, to the end, I could not implement game_view class properly.
Lastly we started recursion which was completely new to me. So far I'm understanding most of the basic examples with the more complex examples being more of a 50/50. I did had a bit of a hard time with the tutorial question since I couldn't figure out how to keep the length of a list without overwriting it with the next iteration.
Subscribe to:
Posts (Atom)