Tuesday(12.08.2014)
Phase 1 Daily Recap
Links

What a day yesterday!!! I stayed at DBC last night till about 11:00pm and since I am living in Mill Valley. I think I only got 4 hours of sleep today. Even thou I only got a few hours of sleep… I feel like I was very motivated!! I am so glade I got that little bit of a nap in yoga today that really helped me get through the rest of the day!!


Today we had a lecture on Block, Procs, and Lambdas. So Basically to sum everything up, a Proc, and Lambdas are both blocks, only difference is a block only runs the code in line. Basically that means, they can not be saved and used later or more then once. Think of every method that we have ever written has been ABLE to take a block!? Why don’t we use them? Simple, the method doesn't know what to do with them, since we don't explicated say use this block.


If you ever run into a error when you use "yield" along the lines of this... "no block given." That just means that method cant find the block so go back and double check that code!!


Lets say we already have a "Block" and we want to save it for later use? All we would have to do is add the "&" sign to the front of your arguments with a new variable name. CONGRADULATIONS!! You just made yourself a "Proc"- (Objects are blocks of code that have been bound to a set of local variables). We can even pass in multiple blocks with "proc","Proc.new", or a Lambda.


After our lecture we started to work on some problems that had to do with class inheritance by creating class methods that would practice Object Orientated Design Principals. The first challenge was pretty easy; it was a good fun to just get my hands on a computer after that lecture!! My partner Ryan, and I both worked really well together and bounced off ideas off each other. We must have been doing something right, we finished pretty easily with very little troubles, when we started to go over our code our instructor Brick came by and gave us great tips in regards to refactoring our code to be more OOD. It was very helpful; we went over the idea that each class we made should be anthropomorphism, Big word… means that our cookies should be in control of our cookies and our oven should be in control of oven. Not to think of our code running to obey to our laws but to think more of how a computer asks to get information.


After lunch we had another lecture on OO Principals with a different instructor, Rao. This was super helpful for a bit, I think towards the end when he started to introduce getting information from different files like a csv file. I got to play around with some csv files and how to extract data and get certain results based on what I am telling my program to get. I am still going to work on reading POODR (Practice Object Orientated Design In Ruby), cant wait to see what tomorrow will bring!!