Friday, February 14, 2014

Week 5



 
Well, fellow Sloggers, I’m sure you need no introduction to the ordeal that was A1. Talk has turned now to the notions of trees and nodes. Although recent lectures have been a bit of a blur, given mainly to the midterm season malaise fogging my brain, one point has stuck: the mantra, “a node cannot have two parents”. If you’re in the Monday/Wednesday morning section at 10, you know what I’m talking about.

Yeah now I’m just stalling.

Anyway, I’ve been enjoying the labs more than I thought I would. This week we learned about two comprehensions, zip and filter, that I wish had been on my radar before now. I can remember numerous times that I had to write such functions longhand, with for loops and if statements and all that. Now it seems like a waste of time. The natural next step was to see what other sort of time-saving (line-saving?) functions already exist in Python for me to abuse and exploit. There is a function called “reversed” that reverses a given iterable. I’m sure that would have been handy at some point. Even more potentially useful is the function “map” which applies a given function to every item of a given iterable. That could have saved me innumerable lines of code over my lengthy programming career. Probably, I don’t 
know, a dozen or two at least.

Right, I started this by talking about trees and nodes. It seems like I’m never going to be able to get away from this recursion stuff. And honestly I’m not sure I’d want to. Looking at these recursive trees blossom is pretty enthralling. Not that I’d admit it to my friends. 

Uhhh....

No comments:

Post a Comment