This week we tackled a different programming technique called recursion, and a structured method of code testing called Unittest.
Recursion is not new to me, I've done it plenty of times in high school through means of contests and clubs. Although I've done it before, I can easily say I am no expert in the area seeing that I was rather confused with regards to tracing Prof Heaps one line code. It's not that his code is too compact, it's more so our methods of tracing recursion slightly differ. He detests the stack based model in which I grew up on, thus forcing me to change my ways. Although I'd say I have fully converted to his ways, I still find it a challenge to think of recursion starting from very simple cases and growing more and more complicated with each step. This building block method is excellent, I can see how it trains you to more easily grasp the concept, It's just difficult having been used to a prior method. None the less the Wednesday lecture with the Turtle animations were really cool and fully engage you with understanding recursion through a pictorial representation.
Unittest was something we were introduced to in CSC108 but I never bothered to actually learn it because I did not have intentions of furthering Python. This being the case, creating my own personalized test cases in lab this week were rather difficult because I had no idea of what to do. My TA refused to help me figure out how to make my test cases work, but I never refuse knowledge when it comes to programming so I ended up figuring it out on my own and getting everything to work perfectly in the end with both my understanding and my code. I can now see the beauty in Unittest although the applications we build in CSC148 are rather trivial so it feels like I'm going over board at the moment.
All in all this week has been great because I was able to somewhat learn new things which is a nice change from CSC108.
No comments:
Post a Comment