humancode.us

Block APIs are NOT harmful

July 17, 2014

Note: This is a repost of an older post that was published on my tumblr blog. Before I begin writing more posts on the subject of programming, I thought I’d practice by reposting something I’ve already written. This post has been re-edited for clarity.

I take exception to Drew Crawford’s recent post that block-based APIs introduce “harmful” surprising side effects into Objective-C, especially under ARC. Drew’s post calls attention to NSNotificationCenter in particular, but really, any block-based API is susceptible to similar kinds of pitfalls.

I would encourage you to download a copy of Drew’s example code as you read his blog post to understand the problem he’s describing.

Read more…

Moving to Jekyll

July 16, 2014

I’ve been wanting to write more blog posts on the subject of software development and code in general, and tumblr just isn’t cutting it for me, mainly because it’s so ridiculously hard to format and syntax-highlight code in the post.

I’ve been intrigued by static site generators, and I finally settled on Jekyll, hosted on GitHub Pages. Jekyll allows me to have manual control over layout and style, and allows me to write posts in glorious Markdown instead of HTML-in-a-rich-editor.

Plus, code:

@interface Hello: NSObject
- (void)hello;
@end

@implementation Hello
- (void)hello {
    NSLog(@"Hello, world!");
}
@end

Anyway, it’s also nice to get back into hacking HTML and CSS. I hope I learn a thing or two along the way.

You can still get to my old blog hosted on tumblr here. The old posts have been automatically imported into this blog (with mixed results).

Not Yet

July 9, 2014

Copyright ©2014 Dave Rahardja

Carousel Detail

July 9, 2014

Copyright ©2014 Dave Rahardja

Girl Brushing Goat

July 9, 2014

Taken at the wonderful Happy Hollow Park and Zoo, San Jose, CA.

Copyright ©2014 Dave Rahardja