Ruby's Socket API from the outside in

I've got a video to share with you today.
 
One of the reasons I love Ruby is the elegant DSLs and wrappers it provides around complex constructs. Socket programing is no exception.
 
In fact, this becomes really apparent when you look at socket programming. The low-level details and intricacies of the Socket APIs can be complex, but Ruby provides nice high level wrappers on top of the hard stuff.
 
So I recorded a video where I show a really high level wrapper that Ruby provides for making TCP servers. Then I tear it apart and show you how it's implementing all of the details under the hood. I'll walk you down several layers of wrappers until we get to the lowest level we can (in Ruby).
 
I take 3 lines of high level code and break them down into 25 lines of lower level code. The pretty 3-liner won't work in all cases, so you've gotta know what it's hiding.
 

Until next time,
Jesse

comments powered by Disqus