Seems like we learned lots of different stuff today!
With learning the latter three keywords, we're yet again closer to our aim of knowing all the Ruby keywords at the end of our Summer of Code.
Bits of Berlin's podcast with our interview is online! Check it out!
- garbage collection: you don’t have to allocate free memory, ruby does this for you. there are two sorts of GC: reference counting and mark & sweep. Ruby uses the latter one. That’s why Ruby might be a bit slower than other languages, but at least you don't have to worry about the garbage!
- Blocks are closures. A closure knows about its outer scopes but it does not leak any of its inner scopes to the outside. JS functions are closures
- raise (same as fail) if …. -> ends your whole program. raise is a method on kernel. Kernel? Yap, it's is a module, where also puts, print, require ….. come from
- rescue -> prevents program from stopping
- ensure -> still runs the code after ensure, even if the method gets rescued
- retry: only works in the context of exceptions. creates a loop
With learning the latter three keywords, we're yet again closer to our aim of knowing all the Ruby keywords at the end of our Summer of Code.
Bits of Berlin's podcast with our interview is online! Check it out!