Wednesday, March 12, 2014

Recursion

Okay, so maybe I don't understand recursion as much as I thought. I mean, sure, I can trace it after it's been written and I can grasp when and the overall idea of how it needs to be used. However, I realized while doing assignment two that I'm not entirely sure how to implement it, after the base case.
I usually start off with the one or two simplest cases, or where I want the recursion to end essentially. Although, getting to the middle, and calling the function multiple times is sometimes really confusing. I found myself comparing recursion to the idea of a  while loop a lot, where you have a condition for which you want the loop to stop and it keeps repeating itself until it gets to that condition.
I suppose more practice will give me a better idea of how to use recursion, in general.

Week Six

Binary tress were a concept completely new to me. Since it built on previous ideas it wasn't entirely confusing to follow in lecture as to how to set one up. Although. I think for me to do it on my own an apply the concept to a new program would be confusing. From what I understood, the basis of a tree lies in a list of other trees, where the value is an input of the root, separate from the list. It was easier to understand how to go about manipulating a binary tree afters seeing it written out as a TreeList. This concept seemed similar to the idea of nested lists, and that's how I figured how to incorporate recursion, as you would be calling whatever function you write on each child of the root, and multiple times thereafter in order to access each child of each node.

Tuesday, March 4, 2014

Week Five

This week learning about unit tests was a bit confusing for me. I knew what they were and how to come up with where to test for from 108, but in terms of writing them using "assert" was different for me and I wasn't sure how to go about that. Seeing them used during the lab was useful because I gained a better understanding of how they worked and how to format them. Although, I was still a bit confused about how to write them myself, it's something that I can quickly go over. Additionally I found working with a partner on the assignment to be more effective than by myself. It was actually a pretty interesting assignment in terms of creativity, and writing the functions was rewarding to see when the program actually worked!

Week Four

For week 4, we went over recursion in nested lists and in relation to the assignment. It was confusing at first to understand how to trace recursion, but after trying it out a few times I managed to follow through. Going through exercise two really helped my understanding of how try/except blocks work and helped my ability to apply raising exception errors. I find it more useful to build up from simpler concepts then going straight to the assignment work, so I find the exercises very helpful to understanding concepts from lectures.

Wednesday, January 29, 2014

Object-Oriented Programming

To me, the idea of object-oriented programming makes a lot of sense, because it can be compared to how thing work in real world. For example, you have an object like a grocery check-out, and you can give it attributes like adding/removing an item, entering a code, or making a payment. Basing your code around this idea makes it easier to follow, and I think for me, made it easier for me to learn. I even began to enjoy coding in 108, and I hope that it continues to be enjoyable this semester too. In comparison, I do find the lectures harder to follow compared to the inverted classroom of 148, which gave more opportunity for learning and questions. I think it'll require a lot more hard work in 148 to understand what is going on. A lot of concepts really encompass a lot of what we already know and then give you a whole different concept to understand.
So far though, the concepts were relatively okay to follow, the ones that were up to classes and multiple inheritance. I'm still confused as to what/how a try block works, but that's something I can ask about at the help center.