Todd Grooms

My Environment Setup

I recently purchased a new 13" MacBook Air (which is a truly wonderful machine). Before I booted the machine for the first time, I started to contemplate what was needed for the machine to be setup for my development needs. I have, regrettably, avoided keeping track of what my environment looks like. I decided to change that. I have started tracking my environment setup on a static page on this site. It may not be the ideal setup for everyone, but I have found that it is the bare minimum of what I need (it is a work in progress and I plan to keep it updated as my methods and needs evolve).

If you have any questions about my setup, please feel free to ask.


Unintuitive Swift

In case you have been living under a rock, Apple announced a new language at this year’s WWDC: Swift. I have been anxious to work with the new language beyond reading the Apple supplied The Swift Programming Language and the new Playground Xcode feature (which is a new way to experiment with Swift without using it in a project). I have recently been working on a new personal project (I am not ready to talk in great detail at this time, but it is a Mac application) and since the project is still in it’s early stages, I decided to convert the project over and start using Swift in this project. Converting the project went smoothly and developers have the benefit of mixing and matching between Swift and Objective-C. I currently have a couple of classes written in Swift that play along nicely with the rest of my Objective-C code. I was skeptical when this capability was announced, but so far it has been working as Apple advertised.

This morning, I was writing some Swift code to validate the input in an NSTextField as it is typed by the user. I am attempting to validate the input as what I perceive to be a valid time format: "s", "ss", "m:ss", "mm:ss", "h:mm:ss", or "hh:mm:ss". In my initial implementation, I wanted to validate that only numbers and colons were input, to break apart the given string into components (with the token being the colon), and to assess each time component to ensure each component was an acceptable length. I am going to step through each one of these tasks and show what it would look like in Objective-C and what the equivalent looks like in Swift (or at least, to what it looks like in Swift to the best of my knowledge at this time; There may be more efficient ways of doing these tasks in Swift that I am not aware of yet). I’m also going to rant a bit about some things that I found confusing in my Swift implementation.

Validating a String’s CharacterSet

Given a string, I want to know whether or not the given string contains any forbidden characters. Given "07:07", the result would be false (does not contain forbidden characters); Given "07.07", the result would be true (does contain forbidden characters).

Objective-C

NSString *timeString = @"07:07";

NSCharacterSet *validTimeCharacterSet = [NSCharacterSet characterSetWithCharactersInString:@"0123456789:"];
NSCharacterSet *invalidTimeCharacterSet = [validTimeCharacterSet invertedSet];
NSRange rangeOfInvalidTimeCharacters = [timeString rangeOfCharacterFromSet:invalidTimeCharacterSet];
BOOL invalidTime = rangeOfInvalidTimeCharacters.location != NSNotFound;

Swift

So there are a few caveats with this solution in Swift. Swift has a Range class that does not directly map to the NSRange structure. I, for the life of me, could not figure out how Range actually works. Furthermore, Swift’s String class does not have a simple rangeOfCharacterFromSet: function (or it’s equivalent); Instead, it has a rangeOfCharacterFromSet(aSet: NSCharacterSet, options: NSStringCompareOptions, range: Range) function. I tried many things, but could not get Range to behave as I thought it would. I realize this has to do with how I think of NSRange and I am trying to just use NSRange in Swift, but I found it very confusing. After hunting through the developer forums, this is the solution I came up with:

let timeString = "07:07" as NSString

let validTimeCharacterSet = NSCharacterSet(charactersInString: "0123456789:")
let invalidTimeCharacterSet = validTimeCharacterSet.invertedSet
let rangeOfInvalidCharacters = timeString.rangeOfCharacterFromSet(invalidTimeCharacterSet)
let invalidTime = rangeOfInvalidCharacters.location != NSNotFound

or

let timeString = "07:07"

let validTimeCharacterSet = NSCharacterSet(charactersInString: "0123456789:")
let invalidTimeCharacterSet = validTimeCharacterSet.invertedSet
let rangeOfInvalidCharacters = timeString.bridgeToObjectiveC().rangeOfCharacterFromSet(invalidTimeCharacterSet)
let invalidTime = rangeOfInvalidCharacters.location != NSNotFound

Breaking a String into Components

Given a delimited string, I want an array of strings for each component. Given "mm:ss", the result would be ["mm", "ss"].

Objective-C

NSString *timeString = @"07:07";
NSArray *timeComponents = [timeString componentsSeparatedByString:@":"];

Swift

let timeString = "07:07"
let timeComponents = timeString.componentsSeparatedByString(":")

Iterating Over an Array Backwards

I will not bore you with the details on how to iterate over an array backwards in Objective-C. That really is not important in this observation. The real quirk is how you iterate over an array backwards in Swift. In Swift, you can iterate with a for-in loop:

for index in 0...3 {
  println(index)
}

The above code will loop four times (the ... in this case indicates inclusive, meaning <= 3; If you wanted to be exclusive, meaning < 3, use .. instead). I assumed that performing this loop in a reverse order would look like:

for index in 3...0 {
  println(index)
}

After watching the loop run for a few seconds, I realized how my assumption was false. My code was iterating many, many times. Have you seen the issue yet? Well, Swift is iterating from 3 to 0, incrementing. The loop starts at 3, then moves to 4, then to 5, 6, 7, and so on. Given enough time, index (which is an Int64 on my 64-bit Mac) will overflow into negative numbers, then slowly work it’s way to zero. I found this to be fascinating. I am not going to say this is a defect, but I will say that I believe this is misleading behavior, given prior experience with other languages. I would have expected the above code to start at 3 and work it’s way down to 0.

I could have used my time here to complain about this, but I will not. This has been talked about on the developer forums, so I will not add to it here. After some digging, I did find a way of accomplishing this task:

for index in reverse(0...3) {
  println(index)
}

Ah, of course: The intuitive reverse() function. How could I have missed that?

What I Learned

I have much to learn when it comes to Swift. It does not help that the language will be evolving while learning, but it makes sense to learn it early (in my opinion) so that I understand what my platform is moving toward. I am coming up on nearly five years of iOS experience and the code I am writing in Swift now makes me cringe. It makes me feel like I am in college again, writing terrible code. Have you ever looked back at code you have wrote while in college? Welcome to learning Swift.


He has his Reasons

The Royal Tenenbaums

Oh, I know that, but you can’t raise boys to be scared of life. You gotta brew some recklessness into them.

Note: This started as a draft on Father’s Day and was finished the following day.

I am celebrating my first Father’s Day today. Ashley insists that I technically celebrated my first Father’s Day last year (as she was pregnant at the time), but I’m counting this one as my first. I am overjoyed that I am lucky enough to be a father. I realize it sounds trite, but my life has been altered, for the better, when Max was born. While I am still a novice at this whole “dad thing”, I have plenty of thoughts and opinions on the subject. If you’ll humor me, I think you’ll find that those opinions may not be what you expect.

Fear

One of the most difficult things about becoming a parent is the pain I feel everyday as I walk out the door and leave my son behind. I didn’t really expect it to affect me, but it does. I hate leaving him. That does not mean, however, that I want to spend all my time with him. To be honest, I occasionally need breaks and that’s okay. Ashley is more than willing to take him when I’m feeling overwhelmed, which is becoming less frequent. I believe what I feel when I leave in the mornings for work is fear. I fear missing his milestones. I fear that something may happen and he might need me while I’m gone. I fear that he’ll forget about me if I spend too much time working.

I read an interesting quote from Steve Jobs, who said that having children is like having “your heart running around outside your body”. I believe this. I feel so much love for Max and so much fear that he’ll get hurt. I get caught up in thinking in terms of “what-ifs”. I hope to come to terms with these thoughts, but one day he’s going to grow up; One day, he’s going to scrape his knee; One day, he’s going to have his heart broken. The knee jerk reaction is to let him grow up inside a bubble and try to insulate him from the big bad world. This is a horrible idea. There are truly wonderful things in this world and I want him to experience as many of those wonderful things as he can. I just hope that I am able to let go at the right times and let him experience life.

Becoming a Father

I believe most everyone has the capability of becoming a father. Assuming you’re not shooting blanks and your partner is capable, anyone can become a father (even if it does require a little help). Should everyone become a father? Hell no. I have news for you pal, having a kid changes your life. For me, I believe it changed it for the better. However, I’m not going to sit here on my high horse and suggest that becoming a father is the right thing for you to do. Odds are, you won’t even know if it’s the right thing for you until it happens. It’s frightening. You’ll be responsible for another human. You’ll have to wake up every two hours for those first couple of weeks and change your baby and ensure your baby is getting fed. It sucks. Every time Ashley and I had to wake up to change and feed Max, we looked at each other and said, “Only one.” Are we going to have more? I have no idea, but one is plenty for me right now.

If you’re going to take that leap though, if you think you want it, my only advice is to be involved. Become involved in any way that you can. Due to certain circumstances, I had to be the one to wake up, change Max, and hand him to Ashley for feeding. I had never changed a diaper until I changed Max. You learn quick. I cannot recommend doing this enough if you are going to become a father. You bond with your child and it makes you appreciate them more… later… much later.

I can’t tell you if having a kid is the right thing for you and I’m not going to sit here in my ivory tower and suggest to you that it’s the greatest thing in the world for every guy out there. My father is of the firm belief that everyone should experience. Fuck that; You are who you are and you may not want that. That’s fine. It doesn’t make you less of a person. For me, however, it’s one of the greatest things in my life. It’s new, it’s scary, but I am looking forward to every day, every challenge.


True Love is Hard to Find

Old School

Sometimes you think you have true love and then you catch the early flight home from San Diego and a couple of nude people jump out of your bathroom blindfolded like a goddamn magic show ready to double team your girlfriend…

I was recently asked by a truly great friend of mine to be his best man. I instantly accepted. After reminiscing and thinking for a few days, this is the speech I wrote. Congratulations Evan and Leah. I love you guys.


My brother and I are separated by nine years. When he was in high school, I was nothing more than a young nuisance who cramped his style. While we are brothers and we love each other, we are separated by a generation.

I found a friend in first grade. He wore glasses and had an eye patch to help a lazy eye. During class, we thought it was cool that we lived on the same street. Over time, we found out that we lived only a few blocks apart. Once we could ride bikes, we started hanging out at each other’s house after school and during the summer.

We watched baseball, we played baseball. We played Nintendo (I loved to dominate him in Ivan ‘Ironman’ Stewart’s Super Off Road; So much so, that on numerous occasions he accused me of cheating). We watched wrestling and talked about X-men. We were inseparable. His family became mine and mine became his. Although we inevitably drifted apart as I went to Louisville for college and he stayed in Mayfield, we still kept in touch and involved with each other’s lives.

When Evan asked me to be his best man, I was honored. It’s not everyday that you get a chance to be apart of such a special moment for a special person in your life. I’m grateful for a moment like this and for a brother like Evan.


Time Machine

Mad Men

Teddy told me that in greek, nostalgia literally means the pain from an old wound. It’s a twinge in your heart, far more powerful than memory alone. This device isn’t a spaceship, it’s a time machine. It goes backwards, forwards. Takes us to a place where we ache to go again. It’s not called the wheel, it’s called the Carousel. It lets us travel the way, a child travels. Round and round, and back home again, to a place where we know we are loved.

A few weeks ago, Ashley, Max, and I were visiting friends. As we left their house, their next-door neighbors were just arriving. They, like us, were also carrying a baby. The only difference was that they had two older kids as well. We made smalltalk, then politely loaded Max into our car and wished them well. As I crank the car, I watch as they crowd together with their dog on their porch for a family photograph. I can’t help but notice everyone with a smile, waiting on the camera, as I put the car into reverse. Snap. The photograph is taken. The family is memorialized; they are forever frozen in time. Later that evening, I reflected on this event with a recurring thought: How many moments I’ve missed freezing in my life because of my and my family’s lack of photography? Also: I feel like an asshole for not offering to take their picture so that the mother of the family could be in the photograph instead of behind the camera.

My best friend since at least first grade (Hell, maybe even kindergarten) is getting married on Saturday. I wish him and his future bride nothing but the best. He asked me to be his best man, to which I happily agreed. I couldn’t bring myself to do the traditional bachelor party thing (I’m married with a child now; I’ll be damned if I end up in a strip joint) so I took him to Chicago to watch the White Sox play the Yankees. This may sound lame, but we grew up together watching the White Sox play on WGN. I also spent a fair share of time in our hometown as this was Max’s first trip to my hometown and there were many family members who had yet to meet him.

As I’ve gotten older, one thing has struck me whenever I visit my hometown of Mayfield, KY: How nostalgic I feel every time I visit. During my time there, I realized that the nostalgia I feel when I visit is not necessarily for the place, but it includes the people and time. Occasionally I long to go back to the friendships that I have outgrown, to the memories that are fading, to life before complication. Every time I visit, I see the debilitating work of time on the people and the places that I remember so fondly from my childhood. This is the crux of nostalgia: It is an old wound, an old memory; It is a lifetime ago, but feels as though it were just yesterday.

If I’m being honest, Mayfield is kind of a shit hole. Compared to the places I’ve lived and have visited, I could never live there again. As sad as it makes me to think about it, there is nothing there for me other than the people and, through the hustle and bustle of life, they are fading. Part of me longs for those connections, for that warm feeling. The smarter part of me realizes that time has past and there is no getting back to it.

I remember many of my classmates, especially in high school, were so keen to leave Mayfield. They always boasted how they would leave the one-horse town of Mayfield and make it big. Many were determined to move to the big city of Nashville (which, as much as I love living in Nashville, is ludicrous as it’s not a very big city). For whatever reason, I figured I wouldn’t live in Mayfield as an adult, but didn’t really think in more detail than that. I never planned on living somewhere else, but just assumed that I would. After all, in a “city” who’s largest employer is Wal-Mart, it is kind of difficult to find potential work in any computer related field, the only plan I actually had for myself in high school. Now, when I return to my old stomping grounds, I realize that I am one of the few to leave.

I find it odd that I need to remind myself, when in Mayfield, that no matter how much I want to go back home, that home is gone. Mayfield is no longer my home. My home is Nashville.


Introducing CoreDataMate

A few years ago, I started development on a project that required long term persistence. Up until that point, most all of my persistence was handled on the server. This project required that I persist data locally on the user’s device, in conjunction with persisting data remotely on a server. As this was an iOS project and Apple is “all-in” with Core Data, I decided I had better get “all-in” with Core Data as well.

I read through every Core Data tutorial I could find on the internet. Regardless of how many times I tried, I just could not grasp what was happening in Core Data. After complaining about this to some of my coworkers, I had a few of them recommend MagicalRecord. I am not going to question the quality of this library; I have no doubt that it is well written and works as advertised. The issue is that I don’t understand what the library is doing behind the curtain. I use libraries all the time, but when I use them, I want to understand what they are doing (more or less) without blindly trusting them. For whatever reason, I simply cannot wrap my head around what MagicalRecord is doing. It seems as though you can arbitrarily create objects on any context and save them. This is one of the library’s goals. However, one thing I have come to understand is that you need to ensure that every thread has it’s very own context so that you don’t “cross the streams” so to speak. Try as I might, I simply could not ensure this using MagicalRecord. This is when I decided to go old school and purchase a book: Core Data (2nd Edition): Data Storage and Management for iOS, OS X, and iCloud.

Don’t cross the streams

After reading through Core Data (2nd Edition), I started writing what I called a “data manager”. The data manager is a simple class that acts as a gateway to your persistent store. The data manager houses a private context which is considered to be the master copy. You do not have direct access to this context from any public facing methods in the data manager. The context that you work with predominantly will be a child context of the private context. This child context is a main queue context that I have appropriately named mainContext. The main queue context will be the context that you predominantly work with. This is the context with which your UI will directly interact.

This is all great, except for the very real use case when you will need to write content to your persistent store. What then? Well, the data manager’s current pattern dictates that you create a new temporary context for your thread (this can even be the main thread if you like, the point is that you just want a temporary context with which to work) whose parent will be the data manager’s mainContext; you will then make any changes that are necessary on this temporary context. After you are finished, you’ll persist your temporary context which will write those changes upstream to the data manager’s mainContext. If that persist is successful, simply call:

[[CDMDataManager sharedManager] persist:YES];

which will write the mainContext’s changes upstream to the data manager’s private context (the BOOL value indicates that it should be a synchronous save; a NO here would result in an asynchronous save). At that point, your new content is in your persistent store and you have the added benefit of your UI already being updated with this content as your changes already exist on the mainContext.

This is a rudimentary example, but I wanted to show how easy Core Data can be to work with, with a bit of caution and understanding. Ready to check out the source code or give it a spin yourself? Head on over to CoreDataMate on Github to check out the source. If you’re impatient and want to play with the code (and you use Cocoapods) just add this to your Podfile: pod "CoreDataMate".


O Me, O Life?

Dead Poets Society

Answer: That you are here — that life exists, and identity; That the powerful play goes on and you may contribute a verse. That the powerful play goes on and you may contribute a verse. What will your verse be?

February was an eventful month. There were three major events that stick out when reminiscing about February: my son’s birth, Facebook Paper’s launch, and the untimely death of an acquaintance from college.

Facebook Paper launched on February 3rd. I rarely use Facebook, but I was excited to install and try out Paper. I’m not a fan of Facebook’s iOS application (or any of their applications to be honest) but the advertising behind the launch of Paper was incredible. Once Paper was live in the App Store, I eagerly downloaded the application.

The install experience was smooth, but I was dismayed to find the voice over tutorial screens. I hate tutorial screens. To me, tutorial or “coach” screens are shortcoming in the user experience design of your application. While I understand Facebook’s desire to include these tutorials (the application is heavily gesture based and I am not sure that gestures lend themselves to be organically discovered), the experience was irritating. The larger issue with their tutorial is that you can leave the application and come back at a later time to a completely different piece of the tutorial. I went for a period of two or three days without using the application and, upon returning to the application, was presented with additional tutorial direction after I, apparently, navigated to a section of the application to which I had not previously navigated. This would not have been upsetting except for the fact that this event occurred while walking around the hospital with my wife and newborn during quiet hours.

Despite my frustrations with the tutorial portion of the application, I think the application is much better than the original Facebook application (although I doubt that it will entice me to use Facebook anymore than I do now). However, one thing struck me on the first launch of the application: On the home screen, where your news feed is allegedly cultivated to show you the most relevant news from your feed, I was presented with interesting updates from an acquaintance that I knew during college. I rarely spoke to him and I certainly did not speak to him on Facebook, so I was curious as to why his updates were above other users' updates. As I read through the updates, I noticed that people were writing on his wall in remembrance: He had passed away. The heartfelt sentiments that his friends were leaving behind were moving.

Even though I did not consider him a friend, I can clearly remember what he looks like. I can remember the students that he frequently sat near and talked with. While I did not talk to him, it was surreal to know that one day he was here and the next he was not and he is now eulogized on his Facebook wall. I could never determine the circumstances of his death, but I stopped reading after coming across a heart-wrenching post from his sister.


A few days later, after an eventful labor, my wife and I welcomed our son into the world. Due to some complications, a Caesarian Section was required. I can still remember holding my wife’s hand in the operating room, my eyes closed, desperately waiting to hear my son’s first cry. At the first note of his cry, I started weeping, which, in-turn, brought my wife to tears. I’ll never forget that moment of pure ecstasy.

In the days after his birth, many of my friends and colleagues have asked me what it’s like to be a father. My answer is not very fulfilling: He eats, poops, sleeps, and cries. I spend most of my time either changing his diaper or trying to rock him to sleep. I am no longer nervous about changing a diaper as I can now do so in my sleep (and I frequently do). Although this time is not what I would consider to be “fun”, there are things that I enjoy. One of which is that I love reading to him at night (so I started a bit early, so what?).

Considering this time, I cannot help but look forward to what comes. It is difficult to stay in the moment and to appreciate the present when the future is so bright. I look forward to hearing his first words, watching his first steps, teaching him how to ice skate, holding his hand on the first day of school; I look forward to all of it. I have to frequently take pause and remind myself that I cannot write his verse. He is the author and is ultimately responsible for his story. I also do not wish to write his verse for him. My goal is to cheer on the sidelines and to give advice based on my personal experiences. He will be his own person and I think he’s going to be great.


In February I was witness to life’s bookends: birth and death. The birth of a person is a joyous occasion filled with the promise of what could be while death is a somber reminder of what will be. I find it to be emotionally difficult to think about this. One thing that brings me comfort is the scene mentioned in the onset of this piece from Dead Poets Society (and I would like to thank Apple’s advertising team for reminding me of how much I enjoy Dead Poets Society): We get to contribute a verse to this play. The beauty of this sentiment is that we are in control of what this verse looks like: We choose which paths we take, the verbs on which we take action, and the nouns with which we interact. We cannot control the length of our verse (although we can certainly help influence it based on how we choose to write it), but we have control in the beauty and the power of it.


Wendy, Let me Explain Something to You

The Shining

Whenever you come in here and interrupt me, you’re breaking my concentration. You’re distracting me. And it will then take me time to get back to where I was. You understand?

My stepfather was an auto body man. He claims that he found his passion during his high school auto body class. After graduating high school, he spent most of his working life beating the dents out of cars. He spent most of his time working for car dealerships. Car dealerships would routinely purchase wrecked cars and hire auto body men to fix the vehicles so that they could in-turn sell the car for a profit. The dealerships would sometimes be able to make a profit of a few thousand per car.

The work was brutal. He worked year round in a shitty body shop with no air conditioning in the summer and kerosene heaters in the winter. Summer time in Kentucky finds temperatures routinely in the 90s and frequently breaking 100°F. The humidity in Kentucky during the summer is so high that a quick walk from the front door of your house to your car in the driveway would leave a thick layer of perspiration on your forehead at 7AM. The winter in Kentucky, while considered mild compared to the northern United States, can still be frigid.

He worked like a dog: forty to forty-five hard hours a week. He was paid hourly. As far as I can recall, he had no benefits. Sick? You’re missing out on pay. Vacation? You’re missing out on pay. He brought home $225 per week. To help make ends meet, he also freelanced on nights and weekends. There was a small detached garage at our house. He would work from 6PM (when he usually arrived home from work) until 9PM (an early night) or until 12AM (a late night). He would also catch up on his freelance work on Saturdays and rarely on Sundays. He tried to save Sundays for his day of rest, which usually involved watching a Winston Cup race.

He was also fortunate enough to be artistically talented. He could charge big money for a custom paint job, sometimes a couple of thousand, depending on the gig. Luckily, there was no shortage of young men who wanted a custom painted car to show off to their friends. Unfortunately, custom paint jobs eat up time. There are hours devoted to drawing out the initial design. Then there is the taping, which can take an entire night. Once the car is taped, the design needs to be drawn out, followed by intricate X-Acto blade work to cut out the pattern. Now you’re ready to paint. There are always many coats involved. And those take time to dry. Many designs require layers of work. It is not uncommon to repeat this process five to ten times for simple designs. If there are any imperfections or bugs (Kentucky summers are a hotbed for mosquitoes and other flying nuisances) the affected area would have to be wet sanded (sanding the painted surface while squeezing a wet sponge over the area), which would smooth out the surface. After all of this, the body still has to be clear coated to give it that protective layer and to make it shine. If done properly, the car will permanently look wet (which was always desired).

My stepfather claims that this was a labor of love. He felt that he was put on this earth to repair auto bodies and to paint them. I feel he was a bit disingenuous. I think his passion was actually art and that his canvas happened to be cars. I believe he repaired auto bodies as a means to an end, to afford him the chance to run his side business so that he could land the custom paint jobs.


I, on the other hand, feel that I was put on this earth to write software. It brings me joy. I have a job writing software. I should be happy about this. And, usually, I am. The issue is that I would like to do more. I would like to learn more. I would like to work on other projects, my own projects. But what do you do when, after working forty hours a week, you are so mentally drained that you can’t force yourself to work on your own projects?

In a manner of speaking, my stepfather had side projects. His side projects kept food on the table and clothes on our back. His side projects were a necessity. I have the luxury of making a very comfortable living in my day job. My side projects are strictly academic or for self advancement. It’s important to note that my side projects are not intended to draw income (although if they did, I wouldn’t be upset). What I have discovered is that passion alone has failed me in my drive to pursue side projects. When I walk into my house I am mentally drained. I want to spend time with my wife. I want to watch television (lately, I’ve been hammering through episodes of Top Gear, British version of course). I want to recuperate. “What about the weekend?”, you might ask. No dice. I’m still tired. I still want to relax and recuperate. But mostly, I want to enjoy my home. I want to take in what Nashville has to offer.

So where does this leave me? Usually agitated. I become irritable about not working on my side projects. If I do find the time and the drive to actually sit in front of my computer, I have rarely left my project in a place where I can quickly pick it back up. Every time I put down one of my projects, I have failed future Todd. I never leave notes for myself so that I know what was happening or where I should go next. If any distractions arise (even something as innocent as my wife wanting to spend time with me) I meet them with an unusually harsh response. I outwardly blame others for my inability to manage my own side projects. “I wish I had more time,“is a common refrain. But there are plenty of other developers who have side projects and they have the same amount of time as I do during a day. So what makes them different? My guess: Planning and priorities.

I would love to give up on side projects, but in my own mind I would feel like a failure for not having them. It seems as though every developer today has their day job and other projects at night onto which they contribute. If I don’t have a side project, am I less of a developer? Probably not. But it feels that way.


You Wanna Hurt Me?

A scene from Planes, Trains and Automobiles where John Candy confronts Steve Martin.

Go right ahead if it makes you feel any better. I’m an easy target.

In the movie Planes, Trains and Automobiles (Oxford comma be damned), Neal blames his ruined trip home on Del. Is Del trying to ruin Neal’s trip? No. Del is just being himself. He’s loud. He’s boisterous. He’s doing what he believes is right. He’s not out to ruin Neal. But Neal, being the cynic that he is, feels that Del is just a buffoon with intentions of malice. I’ve run into a few Dels during projects. And I’ve unfortunately became Neal in many of these situations. It’s not something that I’m proud of, but something that I’m working toward improving.

I recently started working on a project at work that we took in house. The project had been outsourced to a developer in South America, but was brought to use to finish that last 5%. I loathe the last 5%. The reason? It’s never just 5%. Inevitably there are foundation problems with the code. There are quirky little bugs. The application is slow. And the code? Horrific. It’s like you’re renovating a house and you hire me to paint it. I come in and immediately fall through the floor. After I dig myself out of the hole, I see water running down the wall and electrical wires dangling out of the ceiling.

I have a tendency to become bitter at this stage. A little at the project, but most of my bitterness comes at the expense of the developer who wrote the code. It’s easy to blame all of your problems on someone else. I wanted to criticize this developer. I wanted to shame this developer. I wanted to humiliate this developer. Why would I do this? Because I’m God’s gift to programming, of course. I would never make these juvenile mistakes. My code would be pristine. My code would have been well thought out. The application would have been flawless. I even feel that the developer may have even maliciously written terrible code. Maybe the developer was intentionally attempting to sabotage the project. Sometimes I have to catch myself and realize that he or she may just be beginning their journey of being a software developer and that he or she may need a little help along the way.

The issue with my hubris is that I’m forgetting a few truths. I used to be this bad (maybe even worse). I am embarrassed by the code that I wrote while I was in college. I sincerely hope no one ever sees code from the first project that I worked on. In hindsight, it was horrible. How did I overcome this? I was fortunate enough to have developers around me who pushed me and challenged me to become better. They gave me constructive criticism. It was face-to-face. There were no attempts at public shaming. I was lucky to work with developers who genuinely wanted to do good things and help others do good things. I believe this has been lost, somewhat, in the past couple of years at our company and by most developers. It’s easy to be snarky toward others with your first projects safely deleted or hidden on a thumb drive that happens to be buried in a drawer at your desk.

When I become irritated at another developer, I explain to them why I’m irritated. I open a code review on them and try to help them improve at their craft. Am I a saint? No. I sometimes exclaim hurtful comments out loud at my keyboard. I have judged the original developer of my current projects unfairly. I have refrained from attempting to belittle him or her on Twitter. After taking a little time to reflect on the situation, I simply regret that I will not have the opportunity to give them feedback. To help him or her improve at something that they love or at least care enough about to do for money. I realize my code is far from perfect, but I figure that if I can help others improve then others can help me improve.

I occasionally have to fight my urge to become Neal. After Neal has blown up at Del (one of the many times), Del goes on a heartfelt rant with this line: “I could be a cold-hearted cynic like you, but I don’t like to hurt people’s feelings.” Perhaps this world would be a bit better for developers if there were more developers out there who cared less about “burning” a fellow developer and more about helping a fellow developer improve. I’m slowly starting to learn this and make this change within myself.


Jesus, Man, Can you Change the Station?

A scene from The Big Lebowski where Jeff Bridges is in the back of a cab, holding his head, asking the driver to change the music.

I’ve had a… had a rough night, and I hate the fucking Eagles, man.

Don’t you just hate it when you’re fast asleep and something wakes you up? It’s irritating. I also have a problem: I have a difficult time falling back to sleep once I’ve been awakened. Do you know what makes it particularly troublesome? When it’s after midnight and you feel like you’re at a god damn Eagles concert because your next door neighbor (separated by 6-8 feet) is listening to Take It Easy at maximum volume. And not just “10 - Max Volume”. We’re talking about, full-blown, Spinal Tap, “These go to eleven” maximum volume.

Irritated yet? Have no fear. I hear the starting notes to Witchy Woman, but he hits the skip button to get to Lyin' Eyes. I’m miserable. The next song I remember hearing is Desperado, followed by Tequila Sunrise. After this, he either turns off the stereo or I black out from either anger or sleep deprivation; I’m not sure which.

I spent my Saturday exhausted. I realize what you’re probably saying: “You’re in bed before midnight on a Friday night? Are you an old person?” Not really. Sure, I turn 28 in a few weeks, but I don’t consider that to be too old. The issue is that I enjoy getting up early and contributing to society (even on weekends). In addition to that, Saturday was a pretty special day as it was our baby shower. Thankfully, my wife was unperturbed and did not wake through Their Greatest Hits 1971-1975. I enjoyed the party, but it was difficult to focus. Fortunately for me, my neighbor rarely has back-to-back performances.

You might be asking why I didn’t knock on his door or why I wouldn’t just call him on the phone and ask him to turn it down (I do have his number, after all). Over a year ago, while he was practicing his drums at 11PM on a Wednesday night, I called the police to come give him a warning. I didn’t file anything official. I simply asked that they stop by, warn him, and be on their way. My wife had just had shoulder surgery, was pretty miserable, and just wanted to sleep. To the police officers' credit, they did just that. When they arrived, the music was so loud (he also listens to music while he practices), they had to go around to the side of the house and yell through his open window for him to come to the front door as he could not hear their knocking over the music/drumming. After that, I felt pretty bad. I didn’t even attempt to contact him before contacting the police. But it’s not like I asked for a citation. Just a warning. After that incident, he gave me his phone number. My wife and I also decided that, as long as he’s putting on his concerts before 10:30PM on weeknights or performing during the weekends, we wouldn’t bother asking him to turn it down.

For some odd reason, I tend to project my thoughts and emotions onto others without fully understanding how they actually feel or knowing what they are thinking. And, for whatever reason, I project onto my neighbor that listening to his music or playing drums is something that he genuinely enjoys doing in life. Something that gets him through the day. He has a physical labor job (unlike me, who sits at a computer all day and listens to all the music he damn well pleases), which is something with which I can’t empathize. This sparked a thought in my mind: What am I working for? What am I doing in my free time that enables me to push forward through a difficult day at the office because I know that something fun awaits me?


I'm Kind of a Big Deal

A screenshot from Anchorman: The Legend of Ron Burgundy during the opening party at Ron’s apartment

I’m very important. I have many leather-bound books and my apartment smells of rich mahogany.

Saturday was kind of a special day (as far as software development goes). I opened a pull request for Shenzhen. Shenzhen is a gem for building .ipa files from iOS projects (it even has support for distributing files to TestFlight, HockeyApp, FTP, and S3). While testing the gem, I noticed a few problems with building schemes in workspaces. I cloned the project to my local machine, played around with the source, until I fixed the issue. It was a small fix, but I had a few concerns.

Lizard Brain

I’m a very novice Ruby developer and I feared I was making an ass out of myself. I thought that my change might be considered hackie. Perhaps I was not conforming to Ruby standards. I’ve written Ruby code in the past, but I rarely let it see the light of day. There are always other, more preferred ways of an implementation (Ruby has methods for everything) and I’m always concerned that I’m doing something wrong or embarrassingly wrong.

I’m also pretty green when it comes to Github. Up until this point, I’ve only had a few pull requests accepted from Martin M on his Maven CXX Plugin (mainly changes to keep the plugin updated to building iOS projects). I’ve worked with Martin. He’s incredibly gifted and he was incredibly kind to accept my pull requests (especially since I know I did them poorly; Sorry Martin).

On top of that, the author of the project is mattt. Yes, that Mattt. Mattt with 3 T’s Mattt. NSHipster Mattt. (Side Note: I’m loving the NSHipster: Obscure Topics in Cocoa & Objective-C book.) With such an extremely knowledgable and talented developer, it felt daunting to be offering a change to his codebase.

Saturday morning, I decided it was time to stop being scared. I needed to learn how to do this properly. The best way to learn: By doing.

I Have the Power!!!

First, I found this awesome walkthrough on forking, working, and opening a pull request on Github: How to GitHub: Fork, Branch, Track, Squash and Pull Request. After about an hour of work, I had successfully opened a pull request. I was thrilled. However, my excitement was tempered a bit. I have heard many stories of pull request purgatory where the author never accepts pull requests and open ones just sit there for all eternity. So I was excited, but I realized that just opening a pull request was half the battle. I had done all I could do: Make the changes, document everything thoroughly in the commit log, open the pull request, and re-emphasize the changes I had made (and why) in the pull request description. Luckily, later that day, I received a Github notification: mattt had accepted my pull request. I was ecstatic. As I read through the full message, I noticed that he cherry picked my changes to avoid the addition to the .gitignore of ignoring BBEdit files (not a big deal, I probably should not have checked that change in anyway; Force of habit really).

I Learned Something Today

I think the moral of my story is this: Just do it (Nike™). In all seriousness though, my biggest enemy is always that nagging voice in my head, telling me that I shouldn’t bother. Or that I’ll fail. Or that people will regard my contribution as meaningless to the project. Or that I’m doing it wrong. I’m constantly fighting this. But as I do more, I’m slowly quieting that voice. I’m not sure if I’ll contribute more to open source projects on Github, but now that I have this under my belt, I’m going to feel more confident the next time the urge strikes me.