• For-loops are overrated: An OO-programmer's guide to map and flatMap

    For-loops are so 2014. Swift provides us with two new functions that can handle jobs that were traditionally done with a loop. Functional programming languages have been using map() and flatMap() for years, but they are also extremely useful in object-oriented languages. And Swift handles these functions with speed, safety, and style.

  • Leave WWDC with a dozen new friends (even if you hate networking)

    WWDC is next week! Can you believe it? I’m pumped about this. It’ll be my first time at the conference and I’m really looking forward to learning new things, meeting new people, and enjoying some cold, foggy San Francisco weather. Plus I’ve heard so much about the Moscone sandwiches. 😛

    I’ve been to a number of conferences and the best part has always been meeting new people. The sessions are cool but you can always watch those online. But the other people? That’s where the value is. The other people are the ones who can inspire you, teach you, become coworkers or lifelong friends. They’re what makes it fun and interesting.

    But creating a real, genuine connection with people at a conference is hard. Some folks associate conferences with “networking”, which no one likes. So as I start getting pumped up for WWDC I decided to write down a few strategies that I’ll use for making friends while I’m in San Francisco.

  • Getting Lazy with Protocols and Dependency Injection

    Welcome back to the exciting world of Dependency Injection! Ok, maybe I get too excited about testing. Last time we talked about what dependency injection is and how to use it in Swift. This time we’re going to take it one step further with the help of protocols and Swift’s lazy keyword.

  • Four Types of Dependency Injection in Swift

    I’ve been working with a large legacy codebase that doesn’t have great test coverage (which I guess is redundant since Michael Feathers defines legacy code as code without tests). As I fix bugs or add features, I also try to add unit tests along the way. But this can get pretty tricky pretty fast and one of the main roadblocks is a class’s dependency graph.

  • What's the big deal with Swift?

    Paul McCartney

    Paul McCartney, snazzy dresser. Probably not a Swift programmer.

    I get it. I really do. I’ve been writing Objective-C since iOS 3 dropped in 2009. At first I thought it was just some crazy language cooked up by equally crazy engineers at NeXT, but then I began to see the beauty in all those square brackets.

  • Comfort and Happiness

    The other day, Seth Godin wrote about the difference between the immediate and the important.

    Chris Guillebeau tweeted about happiness vs meaning.

    And on an episode of the Tim Ferriss Podcast (though I can’t remember which!) Tim mentioned, “most people mistake comfort for happiness”. That quote has been rattling around my brain ever since.

  • Hello World!

    I went to a conference a while ago and met a fantastic young developer. She was just a year or two into her career and was full of great ideas and great questions. I was impressed that she had already started a blog with a number of thought-provoking posts. Though I’ve been programming for quite a while I’ve never had the courage to put my thoughts out on the internet, though I’ve benefited tremendously by all the wonderful developers who do have the courage.

    So I was inspired to start a blog.