Recursion Blocks

May 15, 2013

App Academy W1D3

Recursion and Blocks

Today we worked with recursion and blocks, two things that are much more abstract and difficult to understand. I had never been good at understanding recursion despite having been exposed to the subject since high school. To me it is just something too abstract and vague to be easily visualized to me. It just explodes far beyond my own brain.

That being said, my partner Brian was great again in helping me understand and do some of the problems. He said that he likes doing these sorts of problems. I do not understand why but I am grateful that he did. The work he did in binary search and merge_sort really came together for me when I ended up putting together the leveshtein distance program. Then Ned came and said that we did not do that one. Sigh.

Things that I learned today:

Splitting things into methods when the program gets too complex helps put coherent thoughts together. There is a lot to be said about sitting back and spending time reiterating to yourself just how your program is supposed to work

I learned about the use of Procs and Blocks and how Procs can be called just like objects. I had amused myself for a brief second by seeing a Proc.new as essentially a little floating virus, unmoving until it meets a living creature that can put it into motion

Yield and calling Procs. There is an implicit and explicit way of calling forth a

Creating recursion in a way that does not require a while loop or an if else statement. It seems like I have always been thinking of them being in that structure since I did my first quicksort formula in Java back in AP Compsci in 2003. It is hard to break out of that mindset but seeing programs that use the structure of something like:

def program(thing) return 0 if x == base case program(thing_in_a_way_that_progresses_towards_base_case) end

sort of helps. Does it mean that me and recursion are lovers? Heck no, but the cold war has thawed just a bit.

Things I think I think:

Reading code on your iPad is tough when reading through the browser

It gets really cold sometimes when you sit next to the window and the cold SF wind blows over your bare legs.

I commute a long way but it still feels great to have a bed to sleep in at the end of the day. I am not sure I can ever crash at the AA building like some are doing.

Some of these solutions that people think of are so radically creative and amazing to me that I feel disappointed in myself and a little intimidated. There are so many great people out there that it gets me a little insecure.