Programming Archive

Block Delegates

Often I find myself implementing the same delegate protocol over and over. Consider, for example, the Facebook SDK for iOS. I’d like to make lots of requests to the Graph API, and not have a single callback method request:didLoad: in a single class that looks like: -(void)request:(FBRequest*)request didLoad:(id)result { if (request == mainRequest) { // handle result } else if (request == subRequest1) { // handle result } else if (request == anotherRequest) { // handle result } //.

Ghetto Text Editing

I realised yesterday that one factor consistently ignored in the old vi/emacs/butterflies debate…is how “ghetto” the method of text editing is, i.e. how degenerate given the available tools. Old terminal-based editors can seem quite ghetto compared to modern GUI-based ones, but after thinking about it you can do a whole lot better.