What Happens After Burnout?

Over the last year or two Jaimee Newberry has been doing a series of talks about burnout. She talked about how she went through a period where work went from being her motivator and her escape to this thing that she just couldn’t tolerate doing without feeling sick. She had to take a step back and take some time off to recover from this.

What happens if you don’t do that? What happens if you work through burnout? Good question. I have the answer!!

Humans Are Not Unlimited Resources

I have been going at 150% since the middle of 2012. I figured out that if I just put a lot of time into learning something, I could get over a hump and actually figure out stuff that was confusing at first. This was a magical revelation to me. I knew that if I put enough effort into something, I could do anything. Nothing was impossible.

I had school through the end of 2014. I started coding 80 hours a week to try and speed up the process of learning things as fast as I could. I had time to make up for. Everyone else had been programming since they were 12. I was in my 30’s and I was a woman. I needed to make up for lost time so I could be on the same level as everyone else. I could back it off when I got a job.

I got my first job and we were encouraged/expected to work at least 60 hours a week. I was the oldest person at this company by a decade. I was surrounded by guys in their twenties who were all on Ritalin who could work 24 hours without sleep. I was the only girl. I had to prove that I could do what everyone else could.

About a week before I got fired, I was so stressed out from this job that I had a panic attack and had a car accident that nearly totaled my car. I knew that this was not good and started trying to figure out what I would do after this.

I wound up working on a contract with Brad Larson for Digital World Biology. I was working on an OpenGL project with two other programmers who had at least ten years of experience. I was the only person on this project who hadn’t gone to graduate school. I had to work really hard to try and keep up and not just be a burden on everyone.

After that I worked on a book. Then I worked for Brad for a year. Then I worked on another book. Then I took a part time job. Then in the same month I switched my full time job. I did conference talks. I traveled a lot. I kept thinking I could manage my time and do more and more things.

I also kept telling myself that I would eventually get a break.

“When I finish this book, I can take a break.”

“I just need to finish this one set of conference talks, then I can take a break.”

“This side project isn’t that hard. It will help me network and it’s almost like having a break because it’s not coding!”

I started falling apart around June.

I didn’t want to admit I was falling apart. I made commitments to people and I didn’t want to let them down. I didn’t want to get a bad reputation as someone who couldn’t be counted on. I have mental health issues and I didn’t want to say I can’t do something because I assumed that everyone else was able to do more than I can and I wanted to work twice as hard to prove that I could do what everyone else can.

Used to just have a day every month or two that I couldn’t function. It usually happened on weekends, so I would just get annoyed that I lost a day or two to work on my side projects.

This started happening more and more often.

A while ago I got really sick and it took me a month to get over it.

I could feel myself falling apart, but I was in denial over it. I did things like getting my subscription food service to deal with things that triggered my break downs. I worked around them. Until I couldn’t anymore.

Last week on the last day of the year, I had a total breakdown. I could not sit at my computer without falling over. I felt like my head was full of white noise. I was sent home early and told to relax the entire long weekend.

I expected the enforced vacation would fix me up like it usually does. It didn’t. I could feel myself not getting better. It was like the forced rest was a tourniquet on a limb that was cut off. I knew if I took the tourniquet off that the bleeding would start back up again.

I had to go through intensive guided meditation therapy yesterday for two hours to get stable enough to continue working today. I have to go back in two weeks. I have been told that this isn’t a magic bullet. If I keep doing what I have been doing for the last three years this will keep happening to me and it will get worse and worse and the therapy will be less effective.

I was told that I need to cut back on everything I am doing immediately. I can continue working, but anything beyond that is pretty questionable. I was told if I work at this I can be close to normal in three to six months.

I wrote recently about tech being a casino and how bad start up culture is. I want to emphasize right here that I do not work for a company like that. I work for Black Pixel. Everyone there has been incredibly supportive of me. My boss Janene saw that I was burning myself out and really tried to get me to take care of myself before things totally collapsed. I think it’s rather sad that so few companies in our industry treat their employees like people and actually care about what happens to them. I wanted to make sure I gave them a shout out for helping me through this difficult time.

I keep being asked how I have time to do all the things I do. I used to say that I could do this because I don’t have a family and I live in the middle of nowhere. I made this my life. But that’s not the whole answer. I have been overclocking myself for a long time and I haven’t done what I need to do to ensure I have a long and fruitful career.

I think that overclocking myself for the first bit of time was necessary. I needed to apply some lighter fuel to my barely smoldering career fire to get it to catch. After it caught, I needed to stop applying lighter fuel, but I didn’t know how. I was paranoid about the fire going out that I thought I had to keep poking it and feeding it and tending it at the expense of taking care of myself. There comes a point when you need to walk away. Not permanently, but long enough to sleep or take a shower or eat something. If you built your fire well, it will still be alive when you wake up the next morning.

Going through this total collapse has really frightened me. I felt like I was omnipotent a few years ago when I realized that I could do anything if I put enough work into it. I am realizing that I took things too far.

I think we need to be better about talking about burning ourselves out. With the pace that our world is changing, we are the weak element here. No one can keep up with all the changes. It’s impossible. As long as we keep thinking there is some mystical full stack developer out there that can keep up with every new framework, device, language, etc… that comes out, we will be causing a lot of unneeded suffering and mental anguish.

We are not infinite resources. There is no shame in stepping back for a while to recover from a sprint. A sprint is not a sustainable pace. It’s necessary to implement periodically, but know that at a certain point you need to slow down and take a break.

I had a lot of success in a short period of time. That came with a cost. I think the cost was worth it, but I need to stop for a while.

My Resolutions for 2016

I woke up on the last day of this year completely non-functional. I am used to having a day or two of non functionality, but I can usually target it for weekends so that I don’t have to tell anyone I don’t feel well or miss work. Wasn’t able to do that a few days ago.

I really tried to make it to the long weekend, but my body gave out on me before then. The wonderful people at my work told me to take off early and get some rest and not to do any work this weekend. It’s a good place and I am happy that I work for people who want me to take care of myself.

Since I am not supposed to code or do any work right now, I have been thinking about what my goals are this year. I know most people are resolving to work out more often or lose weight or whatever. My goals are going to be a little different.

  • I am not working on another book
  • I am going to release an app or an open source project
  • I am going to clean and organize my house
  • I am going to make more of an effort to entertain at my house
  • I am going to cook a complicated special meal once a month
  • I am going to make complicated special dessert once a month
  • I will go on a real vacation this year

I am not working on another book

I can’t do this any more right now. When I worked on my first programming book, I was between jobs and I was able to dedicate all of my time to working on it. There was a period of overlap, which was incredibly difficult. I wasn’t planning to work on one this year, but a series of events lead me to work on the Swift Apprentice.

Working on that broke me.

I would sit down to work on it and feel my head filling with white noise. Even thinking about going to work on my computer made me want to curl up in a ball and cry. I missed a lot of my deadlines and I felt horrible for not doing what I promised to do. I was supposed to do two chapters but I could only pull myself together enough to do one.

I don’t know why this project was the one that broke me. I had worked on other books and wrote articles for Objc-io, but this was the straw that broke the camel’s back. I have been trying to recover from it ever since.

Everyone on the Swift Apprentice was incredibly supportive and understanding. I do not want this to come off in any way like I am blaming anyone there. I had no idea what my limits were until I went over them. I actually wrote a long pitch to Ray about a Metal book on the way home from 360iDev. I had only gotten about three hours of sleep a night for a week and a few hours after I wrote him that pitch my body gave out and I nearly passed out several times on my trip home. I slept for two days after that.

I think when I am about to crash I go into denial and try to add even more work to myself because I don’t want to admit that I am spent. It’s taking me longer and longer to recover from a crash and they are happening more and more often.

So I am not going to work on anything extra this year. I just can’t. I will keep blogging and doing other writing for myself, but I am not taking on anything with a deadline for someone else this year. I just can’t do it right now.

I am going to release an app or an open source project

Going along with the previous resolution, I need to do some work for myself this year.

Most job postings require you to have published an app to be hired. I have gotten around that by working on books and talks and working for very intelligent people.

So far in my career I have never done anything for myself or on my own.

I found it hard to justify working on my own things when I had so many opportunities presented to me. It astonishes me that I have written a book with Chris Adamson and worked for Brad Larson and have had the incredible privilege of joining the Ray Wenderlich team. I keep waiting for someone to tap me on the shoulder and tell me that I am living someone else’s life and it’s time to go back to my actual one.

It bothers me that I have not finished something of my own. I pushed it off to the side while I tried to establish my career. I know that doing something of my own would establish it further, but stuff kept coming up. I kept thinking I would work on it when this current thing was over, but then another thing would come along and another.

I know this is totally a first world problem that I have too many good opportunities. I took a lot of them because I found it hard to say no. I need to do that this year because I need to focus on what I want to do and be known for.

I did the writing and the speaking because I wasn’t super comfortable with my programming skills. I was a beginner and I needed to find a job to support myself. Doing things I already had experience with helped me jumpstart my career. It was the right move to make at the time.

Now I want to focus on showing that I can code. I want to find something that hasn’t been done before and I want to figure it out. I want to do this for me. I don’t care if an app I write makes a penny, I want to make it because I want to know I am capable of doing so.

I am not putting this off any longer. I am doing something for me this year.

I am going to clean and organize my house

I have written in the past about my house. I started organizing and cleaning it a month or two ago. I noticed over the last week or two that it’s been sliding back into chaos. That should have been a warning to me that I was heading for a crash.

One problem I have is that I don’t have an organizational structure. I can’t put anything away because there is nowhere to put anything away to. I have been boxing things up and storing them in the basement.

2015 was the first year where I had to actually pay bills and budget stuff. I was terrified of running out of money, so I didn’t really invest in things for my house for a while. I was also gone most of the time and it was easier to just not think about it. I had two rooms in my house I never went into because I was never home.

Now that I work from home, it bothers me to see how messy everything is. I have never gotten to decorate my home before. I didn’t think of this as my home until recently and I have started to become mentally unfrozen about it.

I am hoping to budge out an amount for shelves for my books and my geeky toys. I want to pain the rooms of the house in colors I like. I want to organize the kitchen and finally figure out what stuff my ex left for me.

I don’t want to sleep walk through my life anymore. I want to be actively engaged in world around me, including the place I call my home.

I am going to make more of an effort to entertain at my house

I live in the middle of nowhere. I also like to plan things and cook. I always wanted to have parties, but neither my father nor my husband would let me do that. It also wasn’t like I had anyone to invite over anyway.

I don’t want to get too isolate out here on my own. I would like to be able to have people come over here and enjoy themselves. The idea of being able to actually plan out a menu and feed people and have people come over here makes me really happy.

I don’t want to be ashamed of the place that I live. I would like to have people come here and enjoy themselves. I would like to have an excuse to dress nicely and have a good time with people. This also gives me an incentive to make sure I clean my house properly periodically and not let it slide into chaos.

I am going to cook a complicated special meal once a month

I wrote recently about having a subscription food service. I like to cook, but I find grocery shopping to be overwhelming.

My weekly subscription is really awesome for feeding myself every day, but the meals are by its nature simplified for busy people who don’t have a day to prepare a meal.

There are a bunch of things I want to figure out how to make that are complicated.

I want to actually organize myself by choosing one complicated thing a month that I will make. I will have a targeted list of ingredients so I don’t just randomly start buying things with the idea that I could make a lot of different things.

I think by planning a day, like the second Saturday of every month, to do something special and to have a targeted list of things I want to do, that I can organize myself enough to do something special.

I could try to coordinate this with the entertaining resolution. I would love to have a dinner party. I know no one does that anymore, but I want to do it and I think it would be fun.

I am going to make complicated special dessert once a month

One thing that has disappointed me as an adult is not being able to bake things. My ex took up the Paleo diet, which doesn’t allow for any kind of baking at all.

This sounds totally stupid, but I grew up thinking that I would be able to bring cookies and stuff to work for my co-workers. I haven’t had a job like that since I worked in the call center. Right now I work from home so I don’t have an office to bring things to. At my last office I was discouraged from bringing food in. I brought in doughnuts once and no one would eat them.

I am bothered by how touchy everyone is about food. Everyone is on a perpetual diet. Everyone thinks that if you eat a brownie you are a bad person with no willpower. It really fucking sucks.

So I am going to make something every month. Hopefully I can find people to pawn it off to. If not, I just want to make it for myself. Hopefully I can freeze it. Hopefully I can serve it at something.

It sucks investing time in making something to have people turn their noses up at it and feel virtuous because somehow they are better than you are because they don’t indulge in things that are bad for them. I made stuffed mushrooms for my parents for Christmas Eve and my dad would not keep the leftovers because I put bacon in them. He talked down to me about how I was going to die before I turned forty because I eat bacon a few times a year.

Life is short. Eat cake. Not every day, but sometimes.

I will go on a real vacation this year

The last vacation I went on was in 2013. I went on a cruise during my winter break between semesters at school. My ex and I spent most of the cruise drinking. He discovered that he loved scuba diving. I discovered that the idea of putting my head underwater threw me into a panic attack.

I wanted to spend the whole time laying around the adults-only pool area relaxing and reading programming books. I was forced off the boat at each port. I didn’t get to do anything that I wanted. I got screamed at at least three times. It would have been a wonderful vacation if I had been alone.

I want a real vacation.

I have gone on trips to conferences. I sing for my supper and they’re all working trips. I have gotten to see a lot of amazing places and met a lot of amazing people. It’s been great, but it’s also been exhausting. The last trip I went on I was awake for 24 hours straight.

I wanted to speak at conferences so I could afford to attend a lot of them, but most of the conferences I went to in 2015 were so overwhelming that the only session I attended was my own. I would spend long periods of time hiding out in my room because I was too spent to leave and see others speak.

I have thought about doing vacations before, but the effort for planning one and the cost have been overwhelming to me. I don’t know how people do cheap vacations. If anyone has advice I would be happy to hear it. The cheapest flights I have been able to book are $350. Then it’s hard to find a hotel for less than a hundred bucks a night. If you are gone a week, it’s at least a grand to just get there and be there. I am sure there are cheaper alternatives, but I have been too mentally exhausted to deal with it, so I haven’t looked into alternatives. I have just written off the idea that this is something I can do.

I would like to either do a cruise or an all-inclusive resort. I want to step off the plane someplace warm and not have to think about anything for a week. I want to not worry about feeding myself. I don’t want to worry about finding alcohol. I just want to be able to set somewhere I can relax and do whatever I want when I feel like it. I want no friction. I don’t want to feel bad that I am not going out and visiting historical places or going to museums. I don’t want to have to figure out where I am getting food. I just want to relax and do whatever I feel like.

If anyone has any suggestions for resorts or cruises they liked, I would appreciate it, especially if it’s targeted at singles. A cruise would be twice as expensive for me to travel as a single person. It might still be the best option, but I am open to suggestions that are different.

Rest and Renewal

I am figuring out the hard way that I can’t work all the time. I have been running myself into the ground for the last three years. I needed to do that for the first couple, but I can’t keep doing it anymore.

I have been afraid of backing off at all. I saw people who have been doing the same thing for fifteen years and have gotten complacent that things will never change. They think their jobs will always be there. They don’t try to push to move up or evolve their jobs.

I picked the handle Red Queen Coder because the Red Queen had to run as fast as she could just to stay in one place. If she wanted to get anywhere, she would have to run twice as fast as she was. I have been running twice as fast for the last three years. It’s time to step back to just running and staying in one place. I need to rebuild my energy for the next sprint.

Halt and Catch Fire

I have a bunch of TV I keep meaning to watch that I tend to “save” because I know it’s going to be a good show and I don’t want to waste it on times when I just want junk food.

One of those shows is Halt and Catch Fire. It’s like Mad Men, only it’s set in the 80’s and it’s about the computer revolution.

I am generally attracted to anything computer related, but there tends to be a few stereotypes you encounter when dealing with technology. You wind up with things like Silicon Valley where the only female programmer you see is a girl dressed in pink whose business is “Cupcakes as a Service” who is wandering the crowd asking if anyone knows Java. You also get the main character, Cameron Howe, in HaCF who is the female super genius hacker chick who drinks and swears like a man.

Cameron is a cool girl. She lives off of pizza and orange soda while managing to weigh ninety pounds. She doesn’t wear a bra. When she gets stuck on a bug she sleeps around with people to get unstuck. She wants to name the operating system after Ada Lovelace and has people telling her she is the next Grace Hopper. She’s a manic pixie dream girl.

The second stereotype is a lot more flattering than the first stereotype. However, it is a stereotype. It is somewhat damaging. There is this idea that if you’re a girl in technology you have to follow a certain mold. You have to be cool. You have to be a nerd and play video games. You have to be attractive in a certain way. Above all else, you have to be better than everyone else. There is more scrutiny paid to you if you are a girl who is a programmer and you can’t just be a good generalist and blend in to the background. You have to be a super star. You have to be flashy.

I benefit from these stereotypes. I happen to enjoy geek culture. I am interested in hard things like OpenGL that most people don’t try or don’t make time for. I am a red headed extrovert who likes to generate attention for myself. I fit a certain mold and I benefit from the positive stereotype.

If Cameron was the only female character in HaCF, then I would not be writing about it. There is another female character in HaCF who I think is far more revolutionary than Cameron: Donna Clark.

tumblr_n7pz8huk9J1qfdofwo1_250The main hardware engineer in the show is her husband Gordon. They met while both of them were going to Berkley studying engineering. She wrote her thesis on data recovery. Donna works for Texas Instruments and is a kick ass engineer in her own right.

She is also a mom. She and Gordon have two daughters.

Donna is a character you never see on TV. She is a working mom in an intense field.

Even though Gordon is a main character on the show, it spends a lot of time from Donna’s perspective. While Gordon is complaining about how hard his job is, he is coming home to a hot meal that his wife made after an equally hard day at work. Except when she gets done with her job, work is not over. She keeps working after coming home. She has to care for the kids and keep her family afloat. Her parents lend her husband money and set him up with business connections to allow him to pursue his dream even though it is tearing their family apart.

Excuse me, I need to call someone to make sure my house is still standing.

Excuse me, I need to call someone to make sure my house is still standing.

At one point in the first season, Donna has a business trip. She will be gone for one night. She leaves lasagna for the family and does everything she can to make things as easy as possible for everyone while she is gone. She comes back to find blood all over the floor, the sink completely disassembled, her children unattended, and her husband digging a giant hole in the back yard.

Compare Donna Clark to Skyler White from Breaking Bad. Even though Walter White is a murdering drug dealer, the show is designed for you to root for him. Skyler is vilified by fans of the show for being a killjoy bitch for cramping Walter’s style.

Someone has been hitting the lead based solder a little hard recently.

Someone has been hitting the lead based solder a little hard recently.

Compared to Skyler, we see a lot of what Donna has to put up with. We see her spinning plates trying to keep the family together while her husband throws the family into chaos. Gordon isn’t seen as this wunderkind genius whose every whim should be indulged and pampered. He is seen as an unstable, sometimes pathetic man who is being used by the people around him for gifts he has that he can’t control on his own.

We need more Donna Clarks on TV.

Back before everyone started playing the start-up lottery and tech became a casino, you had women who were engineers and mothers. It was a solid nine to five job. You had to be stable and reliable and it was possible for women to be mothers and engineers. That is far less tenable now.

There was a company board member I talked to at one of my previous jobs who I feel exemplifies the problems we are currently seeing in tech.

This guy was married with daughters. He also worked in the Bay area while his family lived elsewhere. He was telling me about how he only sees his family one day every week or two because he’s traveling all the time. I was upset for his wife and asked if it was hard. He told me he was used to it. I was annoyed and clarified I meant was it hard on his wife and kids. He smirked at me and said, “Well, they got used to it.”

I got the impression from this person that he figured I was doing programming as a hobby. I mentioned how one morning I made frozen pizza for breakfast and he said, “Hey, enjoy that while you can before you get married and have some kids.”

It was just assumed that I was going to get married and have a family. This was just something I was doing to keep a roof over my head until that happened.

I felt that this person saw no point in cultivating me. I think he saw doing anything to cultivate me would be a waste because I was just going to marry someone and fulfill my purpose of being a caretaker.

This attitude really fucking sucks, and not just for me.
worldPossible
I sacrificed a lot to be a programmer. I decided I wanted to be a programmer because it was something I didn’t understand and it bothered me. If I found a job that paid me to do it, cool. That was icing on the cake. I wanted to learn it and master it because I wanted to know it. I sacrificed my marriage and my mental health and my social life to push myself to get where I am right now. This isn’t some hobby that I am doing while I am waiting around to find some guy to give me children.

I would like to get married again and have a family, but I don’t want to do those things if it means I am lobotomized. I don’t want to be an effective single mom because the father of my children is never home. I don’t want to be with someone who assumes I will just give up on all of my hopes and dreams to make theirs possible.

Let’s say I found someone who would respect me for my hopes and dreams. Let’s say I find someone who wants to split the parent teacher conferences fifty fifty and will watch the kids while I go and speak at conferences. They won’t be able to do that.

Programming isn’t a job anymore. It’s a lifestyle. It’s a cult.

After people figured out that four people in a basement could create companies that are worth ten billion dollars, suddenly tech became a cult. You don’t just have a job, you are working on something that will change the world. You are expected to dedicate body and soul to this grand and noble scheme that will result in millions of dollars for other people.

It’s not okay for you to tell your boss that you are leaving in the middle of the afternoon to take your child to the doctor. You can’t say that you don’t want to fly to China for two weeks because you want to be home to tuck your kids into bed.

hacf-s1-kerry-bishe-QA-120One reason everyone wants young guys as programmers is because they don’t care about this stuff yet. People say it’s because they are more up to date with the technology or that they are prodigies or whatever else, but it’s all bullshit. It’s about finding the most exploitable people you can to get as much out of them as you can until they break.

It’s just assumed that you either will never get married or if you do that your wife will make this life possible. Your wife will watch your children while you are gone 300 days out of the year. If you are a woman and you have kids, people will assume that you are going to be the one to care for them and you’re not cultivated because you’re not going to be okay with being gone 300 days out of the year.

This system sucks. It sucks for everyone. It sucks for the women who don’t have opportunity because everyone assumes you are on the mommy track. It sucks for guys that they spend most of their lives working to support a family they never get to see. This system only benefits sociopaths.

As long as mothers are invisible, then no one has to bother thinking about how fucking broken this system is. Everyone goes along with it and won’t question it because they’re afraid of being cut off from it or seen as a trouble maker.

Bill Watterson, the creator of “Calvin and Hobbes”, was notorious for refusing to sell out. He never licensed Calvin and Hobbes. No one had little stuffed Hobbes dolls next to their Dogbert dolls in their cubicle. No one has mugs with Calvin on them. He didn’t care about making a bunch of money. He didn’t care about being famous or being a public figure. He wanted to do the work that fulfilled his soul. He had an amazing quote about how he chooses to live his life:

Creating a life that reflects your values and satisfies your soul is a rare achievement. In a culture that relentlessly promotes avarice and excess as the good life, a person happy doing his own work is usually considered an eccentric, if not a subversive. Ambition is only understood if it’s to rise to the top of some imaginary ladder of success. Someone who takes an undemanding job because it affords him the time to pursue other interests and activities is considered a flake. A person who abandons a career in order to stay home and raise children is considered not to be living up to his potential — as if a job title and salary are the sole measure of human worth.

You’ll be told in a hundred ways, some subtle and some not, to keep climbing, and never be satisfied with where you are, who you are, and what you’re doing. There are a million ways to sell yourself out, and I guarantee you’ll hear about them.

To invent your own life’s meaning is not easy, but it’s still allowed, and I think you’ll be happier for the trouble.

Take the trouble.
halt-and-catch-fire-episode-103-pre-980x551

Life Hacking: Phase Two

I finished my second week on my schedule. My first week was a little rocky, but the second week worked better. I only missed one day of yoga and meditation.

I am really surprised, but my house is coming along a lot faster than I thought it would. After I started breaking it down into manageable tasks, I made a lot of progress. Knowing that I was going to give away or throw away a lot of my junk really helped.

After the initial excitement of getting house clean subsided, I was still left with an empty feeling. I thought maybe I was just lonely, but I tried interacting with other people and it didn’t go so well.

I’ve felt rather empty since I went to CocoaConf San Jose. I couldn’t really put my finger on why. I still really can’t. It might just be a new phase of the depression, but I am trying to figure out what to do to fill the hole in my soul.

The meditation and getting my house clean is helping, but I still feel a lot of melancholy about the direction my life is going.

Doing What You Love

I saw Brent Simmons talking about his reflections on getting older at CocoaConf San Jose. One thing that he said specifically really connected with me. He said to do what you love.

He said that he loves working with text and HTTP. I have things that I love that I don’t get to work with because I don’t know them well enough to really make a go of them.

I met my mentor Brad because I wanted to learn OpenGL and work with GPUImage. He hired me to come work for him, but we didn’t work with those things. We did this really amazing project where we rewrote our robotics software in Swift. It was an incredible experience and opportunity, but I felt like my iOS and Cocoa skills were atrophying. I also had to drive sixty miles a day and I had no time or energy to work on the things I loved.

I started working for Black Pixel recently. I work remotely. It’s been really nice to not have to drive two hours a day and never see my pugs, but I am still not working on the things that I love. This is to be expected. I am a new programmer and we all have to work on things we don’t necessarily love. I am not trying to be bratty or anything, I am just trying to figure out how to balance out what people need me to do with what I want to do with what I need to do to keep from falling into a depression.

I like to dream about just quitting my job and spending three months doing whatever the hell I want, but I know that wouldn’t happen. I would be okay for a day or two, then my lack of structure and deadlines and accountability would throw me into a depression and I would get nothing done. I dream about taking a coding cruise where I spend a week working on whatever I want with no distractions, but I know I would go crazy not being able to check on Twitter every five minutes.

I might be able to get to this point at some point in the next few years, but I am not there now.

I need to figure out how to put myself on a path that I want to be.

One thing a lot of people ask me is how I wound up working for Brad. I got to work for him because I was very targeted and focused on what I wanted. I had a list of five companies (including Black Pixel) that I eventually wanted to work for. I decided I would not take any job that did not further that goal.

I talked to so many of my classmates who would not just specialize and get good at one thing because they felt like they had to know a little of everything in case someone wanted to hire them to do any of them. So there are lots of people who I talk to who complain about being stuck working on Java because it pays the bills and it’s too hard to make the move to something they didn’t invest capital in, like iOS.

This scares the crap out of me. I am terrified of becoming an expert in something I hate and then being too apathetic to make the move to something I love because it’s too lucrative for me to stay with what I am doing. This is trap. This is the path to the Dark Side.

So what do I do?

Getting Back on Track

I need mental discipline. I need structure. I am starting to work with this by setting up a schedule for myself. Now that I am through the first few weeks of my schedule, it’s time to evolve it a little.

I want to be a graphics programmer. I need to spend time learning how to do it and doing projects. This is what I am adding to my schedule.

My plan is to do something every week and write it up on Sunday. I have a tentative list of things that qualify for that something:

Learning Project List

  • Make a decent OpenGL Template
  • Write custom shaders for GPUImage
  • Analyze and write-up an explanation of the math and code in a shader in GPUImage
  • Read a chapter in a book like “Metal By Example” or “iOS Drawing” and then do a sample project based on what I learned in there
  • Work through a tutorial on Core Animation, Sprite Kit, Scene Kit, etc…

I noticed that people tend to want to talk to you about things you talk/write about. Right now I am talking a lot about cooking and depression and getting my house clean. I am afraid if I don’t talk about tech that people will stop thinking of me as a tech person. I want to talk about tech that I want to be an expert in, so I need to make time for it because it is important.

I have a few larger projects I would like to work on, but I don’t want to write them here. I think last year I said I was going to spend this year building an analog synthesizer and it bothers me that I haven’t done that yet.

My goal here is to have several talks ready on graphics programming for the Spring conference tour. I would also like to be able, six months from now, to plan a vacation where I go on a cruise for a week and I actually have the mental discipline to get a sizable chunk of work done. I want a plan of attack on one of my projects and I would like to be mentally at a point where I can take advantage of that situation and be productive.

Shout Outs

I want to give a shout-out to my boss Janene at Black Pixel. I tried to talk her out of hiring me because I am a mess and she told me that she knows and wanted to hire me anyway. I am going through some issues right now that I have been avoiding for a while. I feel like running away from my life sometimes. It’s helpful for me to get toxic thoughts out of my head and she’s been very kind in letting me just get them out even though I know they sound really bad.

I was worried when I left SonoPlot that I would lose my mentor, but I gained another one. I gained one that I need right now and I appreciate her helping me figure out what I am doing with my life.

I Need Help

I have written a little bit about my food situation and my weight on this blog. I have been on my own for almost a year and things that I put on the back burner are starting to boil over a little bit and I feel like I need to pay attention to them.

When my ex moved out of the house and I got to control my own food, I thought that I would lose the twenty or so pounds that I put on the last few years of our marriage. The marriage was going badly and I had started programming, which basically consumed my entire life. I figured after he left I would be able to eat the way I wanted to and that the weight would gradually come off.

The weight has not come off. It has been stubbornly hanging around. I have been somewhat passively trying to eat healthier. I cook my own food, which is usually things like chicken that are made up of lean protein and a lot of veggies.

I joined a gym a year ago, but I haven’t been able to go regularly. I would go once or twice, then I would basically become exhausted for weeks afterward. I didn’t get tired the day I went, I would just feel horrible and shaky for weeks afterward. I tried to push through it but I just kept feeling worse.

I know at this point it sounds like I am in terrible shape. I can walk all day and feel fine. I did that while I was out here in San Jose. I take a long vigorous walk each day when I need to clear my head and I don’t have the weird sweating or heavy breathing or heart pounding that you tend to get when you are horribly overweight or out of shape.

I think that my body right now is in a state of shock over everything that has been going on the last few years and, for lack of a better explanation, my code base is fragile. I can’t add new things to my life without my body completely freaking out. I wrote about having my conference plague that wouldn’t end and I can feel it giving out on me.

I don’t really know what to do. I am in trouble and I don’t know how to fix it.

I talked to Jaimee Newberry and she said that every time I talk to her, I am stressing out about being fired. I am constantly freaking out that I am letting someone down or not living up to what I need to be doing. I have been perpetually doing this since 2012.

Back in 2014 I had a few months where I basically never left my bed. I would get up, program all day, and basically drink from noon onward.

I have been abusing my body trying to catch up to where I think I am supposed to be and I just need to prioritize figuring out how to feel better. I am tired of feeling stressed out all the time. I am tired of feeling chubby and not really knowing what to do with it. I am tried of drinking every night because it is the only way I have to signal my brain that this is when my day is over. I am tired of being too mentally and physically exhausted to go to the gym and run because I actually like running. I would like to be able to do it regularly without causing a system-wide crash.

I need to figure out how to restructure my life. I need to find some other way to relax that doesn’t involve me automatically drinking wine every night because it’s the only way I can tell my brain to stop working. I am very ritualistically oriented. I have to brew my tea every morning before I start working because it’s the way I tell my brain it’s time to work. I need to find another solution for telling my brain when work is over.

I need to stop stressing about getting fired. I am not saying that I should assume I never will, it’s just that the perpetual worry about it is causing me a lot of problems.

I need to figure this out. I am poisoning myself and I can’t keep doing this.

The first step towards fixing a problem is to acknowledge that it exists. I need to make a plan to figure out how I am going to incrementally fix myself. I learned programming and worked on two books and I have been able to do a lot of amazing shit. I can do anything I put my mind to. I can do this. I just need some help.

Plague of the Damned

The last two months have been among the most stressful I have had since I started programming. It has been more stressful than writing my first book or working at my first real programming job or even as stressful as when I essentially dropped out of school due to a nervous breakdown.

In September, I took over the Swift tutorial team at RayWenderlich.com. Part of the reason for my decision taking over the team was related to my previous job. At the time, I worked for SonoPlot. I had worked for them for a year and I was trying to figure out where my career was going. I had spoken about this with the company a few times, and it was pretty well established that there was not exactly a lot of growth potential for me there. Most companies have management as a potential way for people to grow within their jobs, but at a company with a few people, that wasn’t exactly an option. Also, SonoPlot is a hardware company. Our software wasn’t the selling point, it was a peripheral. I was trying to figure out some way of staying there without feeling like I was just stuck in a dead-end job, and doing a part-time gig managing a team on the biggest tutorial site for iOS seemed like an ideal compromise. I would get some exposure, work with really smart people, and have a chance to impact the way that people learn this new language! Awesome.

Things did not work quite the way I expected…

I received an offer I could not refuse from Black Pixel. I had dreamed of working for Black Pixel eventually, but I didn’t think “eventually” meant “right now.” While I was talking to them, I realized I would be a fool if I didn’t accept the job. So in September, I started two new jobs, while also trying to finish working on a book.

I tried to get my start date to be after I finished a week of speaking at two conferences in two different states, but that was not considered an acceptable option. I have never traveled to and spoken at two conferences in the same week. I was home for only two days between them. I was really looking forward to doing what I always do after a conference, get right back to work and focus on getting things done.

This is not what happened.

My mom is the best. She brought me some medicine. And some stupid DayQuil.

My mom is the best. She brought me some medicine. And some stupid DayQuil.

A few days after I got home, I got sick. I mean REALLY SICK. I had had migraines in the past and just generalized exhaustion, but usually my body had the grace to have these things happen on weekends so I would just be annoyed that I didn’t work on my side project because I was stuck in bed.

I would wake up in the middle of the night coughing my lungs out. All of the muscles in my back spasmed. I was working from bed because trying to sit with my back muscles spasmed was just too painful. I took cold medicine that did nothing and I had to ask my mother to go to the liquor store for me to get some honey whiskey because drinking hot tea with lemon, honey, and a good slug of whiskey was the only way I could stop coughing for a short period of time. I finally reached a point where I simply could not work anymore and I had to finish my week early and take a weekend to get better.

That weekend was not enough.I was told to go to the doctor after that weekend to make sure I didn’t have pneumonia. I didn’t have a fever, my lungs were clear, and my weight was ten pounds over what my “overweight” marker is. I was not a happy ninja.

Don't mess with the Janie Ninja! She is sick and cranky.

Don’t mess with the Janie Ninja! She is sick and cranky.

Even though it’s good that I didn’t have pneumonia or consumption, it was kind of like, seriously? I feel like dying here and there is nothing you can diagnose me with that sounds really scary so that I am not just a wimp? I was offered prednisone, but that stuff scares the living shit out of me and I refuse to use it unless I am dying without it.

This past month has really sucked and been completely demoralizing. I am upset that my first month on my new job was taken up with me being gone then having the Plague that Would Not End. I am mad that I spent a weekend in bed trying to get better when it didn’t work and I couldn’t just start the following week bright eyed and ready to go. I am mad that I am still kind of sick and this will not fucking go away. I am traveling in a few days and I am afraid of picking up another bug that won’t fucking die. I am sad that the people I am working for have a bad first impression of me because everything I have been doing all slammed me all at the same time and my stupid body gave out and wouldn’t let me do anything.

I am grateful and appreciative of all the people I work for who were incredibly understanding about this situation. I know I have let people down and that vexes me tremendously. No one has made me feel bad about this. I am making myself feel bad because I hear myself giving this constant stream of excuses about why I am not getting work done and I hate this person I am being. I don’t have anyone to blame but myself and I am angry that it has taken this long to get better.

Here is what I am doing about it.

I am organizing myself. I am taking responsibility for the things I have not done. I am going through and trying to take stock of what I have let slide. I am working to fix it.

Take two pugs and snuggle in the morning.

Take two pugs and snuggle in the morning.

I have been pushing my body to its breaking point for the last three years, figuring it was just a crunch. I need to crunch to learn enough programming to get my first job. I need to kill it at my first job to avoid being fired. I need to kill it at this book to get a better job than that first job. I need to kill it so that I can learn all this awesome code from my programming mentor…

I can’t do that anymore. I need to make taking care of myself a priority. Yeah, it might mean that I miss out on some once-in-a-lifetime side project app opportunity that will only happen once that someone else might do or might just go away. I might miss out on an amazing conference. I might miss out on insert-cool-thing-here.

One reason that Xerox missed out on the computer revolution wasn’t just that they didn’t recognize the opportunity. They didn’t have the structure or the bandwidth to take advantage of it. Their business model and structure didn’t allow them to easily adopt producing personal computers. One reason Apple succeeded at this was because they gambled and went all in. Xerox could have done that, but it would have been a terrible business decision.

At some point, you have something to lose.

When I took up programming, I had nothing to lose. I had time. Time is important, but considering the return I got on that investment, it was a good decision. Right now I have basically made it. I am working at the company that was my dream job and I get to work with the people who taught me programming and to have an impact on how this new language is taught. I have career investments in things and as cool as it would be to learn virtual reality or electronics or even Metal, I need to offset the risk with the bandwidth it takes away from the things that are working for me now.

I am not going to give up on this stuff as a hobby. I simply have to acknowledge it for what it is and not think of it as an investment in my future. Making sure I have food and that my house is clean is more important right now than writing my own app or starting another book. I have people counting on me to do my job and I need to take care of myself so that I don’t let those people down and burn out.

Remind me of this in a month when I will inevitably talk about the next book I want to write.

One of these days I will play all of Mass Effect.

One of these days I will play all of Mass Effect.

Minimum Viable iOS Engineer

Parable of the Shrew

My father works at the Botany Department at UW-Madison. When he was a graduate student he worked as a naturalist at a state park in South Carolina. When I was growing up he told me a lot of stories about this park. One story that he told me in particular has stuck with me most of my life. I have been meaning to write a blog post about it, and I feel like now is the time.

One day while he was working at the state park, he found a shrew. A shrew is a small rodent that eats crickets. My dad captured it and took it back to the office with him. He knew it ate crickets, but wasn’t sure how many or how long it had been since the shrew had eaten. He wanted to be safe, so he put the shrew in an empty aquarium with a hundred crickets, figuring that would be enough.

He came back the next morning to find the shrew dead on its back with all four little furry feet in the air. It was surrounded by dead crickets. The shrew was so fixated on killing every cricket in the aquarium that it forgot to eat any of them and it starved to death surrounded by food.

Resist the Temptation to Be the Shrew!

Yesterday Apple had their announcement of the new tvOS, along with a lot of other new toys that made my head spin.

I noticed a lot of people dropping the watchOS stuff to pick up the new tvOS stuff because it was the new thing and they didn’t want to get behind.

I want to say something that is going to make you feel bad. Take a deep breath. Relax. Here goes.

We have reached a point with the platform where we can’t know everything.

When I started programming I figured I would learn a few languages to cover my bases and give me options for when I went looking for a job. I realized that this was a bad tactic so I picked the one I most wanted to work with. I have further specialized to more and more specific areas of Apple development.

Every time that something new and shiny is announced, I feel compelled to learn something about it. I have Ray Wenderlich’s WatchKit by Tutorial on one of my computers and I don’t know if I have ever opened it. I also have their Animations, Core Data, and several years of iOS By Tutorial in a folder on my computer unread. I feel an incredible amount of panic because no sooner do I hear an announcement about something, my Twitter feed explodes with people who have dug into the docs and are sharing what they read. I have barely processed that something new has come out and already people are doing something with it. It gives me tremendous anxiety and makes my head spin.

I have been working myself into a tizzy just trying to keep up with what I am doing at my job. I have not used the iOS frameworks in about a year. I have a book out on iOS development but I don’t use it every day and it’s basically gone from my memory. I know if I had to use it every day I would pick it back up again fairly quickly, but it still disturbs me that I just don’t remember this any more.

I keep feeling like I need to know Core Data and Networking to stay marketable. I have a list of things that I think I need to know because if I don’t know them then I am not a real developer and people will shun me when they find out. This fear leads me to work all the time. I regularly suffer from exhaustion. The last two weekends I spent two days in bed internally screaming at my body for giving up on me because I have deadlines I need to meet and I don’t want to let people down.

I can not continue this way. If you are going through this, you can’t do it either.

This year at 360iDev there were a lot of talks about the death of independent development. We’ve moved beyond the point where you can make an app in your free time on nights and weekends that is going to be a minimum viable product. Believe it or not, this is a good thing.

Back in 2009 when the platform was relatively new, you could know everything. It was possible. The reason it was possible was because the platform was incredibly limited. There were a lot of things you couldn’t do, or couldn’t do easily. Now we are living in an embarrassment of riches where almost everything is possible, which means YOU CAN’T KNOW EVERYTHING!! Stop trying!

What is the Bare Minimum You Need to Know

I celebrated my first work anniversary on Tuesday. Before that I worked at a start up for two months, worked on an OpenGL contract application for three months, coauthored a book, and did over a dozen conference talks. I have a shocking amount and diversity of experience for a developer who has less than two years of experience.

I don’t know Core Data. I don’t remember most of iOS. I haven’t worked with Interface Builder in a year even though I intended to specialize in graphics and design for iOS.

I think that the amount of things you need to know to be a beginning iOS developer is smaller than most people think.

I talk to students at the tech school I attended and all of them think they need to know a lot of stuff. I would argue that you don’t need to know a lot of stuff, but the stuff you do need to know you need to know well.

Here is my list of what I think you absolutely need to know to have an entry-level iOS job:

  • Some fundamental understanding of either Objective-C or Swift. Both of these languages have a lot of unique aspects and I would argue it is important to have enough of a grasp of one of these to understand why you don’t program them like Java or some other language.
  • The MVC design pattern. This is a fundamental pattern that permeates all of iOS. If you do not understand this pattern, you will not write good iOS code. It is vital to understand this.
  • Know how to use the Apple documentation to look up how the frameworks work. You can’t know everything, but you at least need to know how to learn what you need to know.

I think knowing Core Data or Networking or any of the other multitudes of things are nice career embellishments, but I think if you are looking to bring on an entry level person and train them, this is what they need to know.

I don’t know how to do Networking. I have never had to know it for any job I have had. Same with Core Data. I know a lot about things most people never need to use like how to connect to a FireWire camera and how to parse LibXML2. These are things I learned because I needed them for the job I have. If I were looking for another job I am sure knowing Core Data would make me more marketable, but I wanted to find the right job for me rather than being qualified for a lot of jobs that aren’t really a good fit.

I don’t think not knowing how to do NSURLSession or how to make an Apple Watch app makes me an impostor or a bad developer. They haven’t affected my ability to get a job yet and I don’t think they ever will. If I need to learn them for something I am doing, I know enough that I can teach them to myself and if I forget them again, then I wasn’t using them.

I worry about people spending so much time learning “superficial” stuff that lets them build an app but does not teach them how the app works so it can’t be applied to anything else. I think instead of creating an aura of fear at not knowing everything, we focus on what is the essential amount you must know and enable people to learn the things they need to know to specialize or that interest them.

Specialize

At 360iDev last year Saul Mora and I were discussing the possibility of setting up something like a co-op for developers. If you had an app idea where you needed to know something you didn’t know, you could post it on this message board and if someone knew how to do it, you could negotiate working with them on it. I don’t particularly want to learn a bunch of stuff I don’t care about to make something and I would love to work on someone else’s project only doing the things that I want to do.

Like all good ideas that are formed by committee, this got bogged down in a lot of implementation details and forgotten. I still think this is the only way for independent development to move forward.

If you have a group of four people with different technical skills working together, you can put out a really nice app in your spare time. The gold rush is over, but I would hope that some people are involved in app development because they enjoy it and have ideas they want to share with the world.

I feel that Ray Wenderlich has embraced this idea. He has a large team of people working together on the tutorials because it simply got to the point where he couldn’t do it alone. We have a large pool of knowledge and resources and we are able to accomplish more than any one person could. I think he’s a great example of what you can do if you start trying to think cooperatively rather than singularly.

I think we need to move away from the idea of the solitary developer working in their basement over a weekend and move towards the idea of having a team of friends you can work with and share ownership of a product with. Even if the app never earns a dime, the act of working with your friends to make something you are proud of is a goal in and of itself.

So, to everyone feeling shitty because you can’t keep up with the new and shiny, stop it. Go easy on yourself. We’re at a turning point where things are going to be different and you can’t hold yourself to those standards anymore. Focus on the fundamentals and what is important to you and you will be fine. The platform has matured and it’s a good thing.

Why I am Not Moving

“Janie, why are you still in Madison?”

This is a question I was asked recently. I actually get asked this question a lot.

For the record, I don’t live in Madison. I live in Deerfield. Deerfield is a village with less than two thousand people, no grocery store, and no traffic lights.

I had a lot of frustrating conversations with people over the winter when I was freaking out about taking care of myself where I was told to order delivery or sublet my house to move closer to work. There is no delivery in a village of two thousand people, one restaurant, and six bars (this is Wisconsin, there is a five bar minimum per incorporated town).

There is no public transportation. I drive sixty miles round trip every day to go to my job. This can easily eat up two hours of my day. The closest actual grocery store is twenty minutes away, so it is rather difficult to run errands because just going to the store kills almost an hour of my increasingly limited free time.

Additionally, I have my pugs who spend way too much time alone in my house and it’s hard for me to go home, feed them, shovel food down my throat, then go back out again after working a ten hour day.

Part of me thinks it would be nice to be able to go out at 9:00 on a week night on the spur of the moment without having to drive a hundred miles round trip in one day. It would be nice to take advantage of my gym membership without feeling guilty thinking about my pugs being stuck in my house alone all day. It would be nice to join the maker space that inconveniently exists equally far away from both my job and my house.

So why don’t I move?

First off, I can’t afford it. Conservatively, it would quadruple the cost of my housing to move downtown, or even closer to my job. After my divorce I effectively have a blank slate. I don’t have any debt (besides my house and my car), but I don’t have anything saved either.

I would have to sell my house. Did I mention the whole living in the middle of nowhere, no public transportation thing? There are a half dozen houses around me that have been on the market for a while. My house is just about the right size for one person or maybe a couple, but not for a family. It’s within walking distance of the school, but in our era of helicopter parenting, that doesn’t mean what it used to.

I feel like I am in a really weird stage of my life right now. I never did the whole partying and dating thing in my twenties. I had some health and social issues and so I didn’t go out to bars and date. I married my ex-husband because we knew one another our whole lives and the dating scene terrified me because the only attention I got was from married creeps who wanted to have affairs (which isn’t that much different right now, to be honest).

Even though I didn’t have kids, I have a lot of the same issues that parents have. I have to go home to take care of my pugs. If I want to stay out after work, I have to make arrangements for someone to come take care of them. I find it incredibly selfish that people tell me that they only want to hang out with me if they can call me on a whim and ask to meet at the bar twenty miles away in ten minutes rather late on a week night. When I tell them I need to schedule something or meet earlier, they get pissy with me and tell me to move. This makes me less inclined to hang out with them because they want me to contort myself like a pretzel and they are unwilling to do one thing to accommodate me.

Last week I did an interview with the Ray Wenderlich podcast. One of the themes of the interview was them asking about all the projects I have been doing. I spoke at, I think, at least ten conferences last year. I coauthored a book. I work a full time job. I am the cohost of NSBrief. I have a lot of projects that I do. I never really thought about it because they slowly added incrementally and the deadlines for each one would come and go then another would take it’s place like Hydra.

I started to really think about what I am doing with my life and how things would be different if I lived in a city like a normal person.

If I lived downtown and I could order takeout and go out drinking at 9:00 on a week night, I would probably do it. I would develop a circle of friends who all do those things. I would probably be more social, have different hobbies and activities, and have something that resembles a normal life.

I don’t think I would find that fulfilling.

When I started programming a few years ago, I was driven by my fears of inadequacy. I was competing with people who had been programming since they were twelve. I was in my thirties and I hadn’t established a career yet. Just yesterday I was talking to a high school student who is on Ray’s tutorial team and I felt a deep sense of shame for squandering my twenties doing stupid crap.

I don’t remember where I read this, but there was a piece of writing Anthony Bourdain did where he talked about his chef career. He said that when he was a young chef, he had two options. He could either take some time really honing his skills by working for better chefs, or he could chase the money by being an okay head chef at a couple of different places. He had a heroin habit to feed, so he chose to chase the money. He talked about Grant Achatz, the chef at Alinea. He was talented enough that he could have been a head chef right away, but he wanted to be a great chef, so he paid his dues for several years by being a sous chef for great chefs so that he could learn to be a great chef. His restaurant is the only consistent 3-star Michelin restaurant in Chicago and he is considered to be one of the greatest chefs of his generation.

I consider my current job to be more than a job. I feel like it’s my do-it-yourself graduate school. I am a much better programmer now than I was when I started here almost a year ago. I have the freedom to ask stupid, esoteric questions without worrying that I am going to be fired for not knowing what a bubble sort algorithm is. I am a sous chef working under a great chef to learn how to be a better programmer (mixed metaphors are pretty).

Right now I have two options for making up for lost time. I can either spend a lot more money to engage in a lifestyle that will be fun for a few years but will do little to enhance my career, or I can accept that living in the suburbs sucks, but that I can spend all of my time stuck at home doing things that will enhance my career and help me make up for lost time by fast tracking my programming skills.

I know most people after a divorce would throw themselves back out into the dating pool and get new hobbies and do a bunch of things to feel free and alive again. It’s a tempting thing. However, I made a lot of sacrifices over the last three years to get to the point I am at now. My fire is burning, but it will go out if I don’t keep tending it. I worked my ass off to get it going after having two previous attempts not get past the kindling stage. As cool as it would be to be a “normal” person and go enjoy my youth, I think that I have a chance to do something important right now and I want to see where I can take it.

Meaningful Relationships and the Art of Networking

Family

My father and I have had arguments about family for most of my life. My father keeps insisting that now that I am an adult I should make a pilgrimage twice a year to go to his family reunions. I don’t see the point in going to these because I had many of these events from my childhood where I felt kind of like we were the Anne of Cleeves juice glass in the collection of wives of Henry VIII. We needed to be there so that there would be a complete set of my father’s siblings and family, but once we were accounted for we were kind of ignored and forgotten.

I came to terms with this at some point in my early adulthood because, honestly, what do you say to people you only see twice a year? Most of my relatives were much older than I was. My cousins were in college and getting married when I was in Jr. High. We were at different points in our lives.

The advent of Facebook and the Internet has made it much easier to connect with my relatives and keep up with what they are doing. We’re also now all adults and it’s a little easier to connect with people when you’re at the same point in your life.

Yet still I fight with my father over the necessity to go there and see people in person. We would have incredibly heated arguments over this and I could never articulate why this bothered me so much until recently, and yes, it does has something to do with networking.

Meaningful Relationships

I guess the things that bothers me about going to various family reunions is that they are perfunctory and superficial. You go, you say hi to the host, you eat your sandwich, you go home.

I observed over many years that most people’s relationships with their families were much different than my own.

I grew up in a very small town where most people had a huge network of cousins and other relatives who were all around the same age. They were thick as thieves in school and continue to voluntarily spend time together as adults. People weren’t just cousins, they were friends as well.

My cousins were not my friends. I really think that they could have been.

I remember as a kid being hauled to the family Christmas brunch where I would usually find a nice corner to sit in and read my Babysitter’s Club books while I waited for presents to be opened so that we could go back to the hotel and go swimming. One thing that happened every year was that my cousins would all go out to a movie and I was always invited to go. My dad would tell them no, I wasn’t allowed to go with them.

After a few years they stopped asking and whatever relationship I had with them withered until I became an adult and reconnected with them on social media.

My mother’s family was closer in both age and geographically and I barely saw them either. I will now go on Facebook and see every cousin of my mother’s, except her, go on a week-long camping trip and other various adventures that we are never included in because we’re not really a member of the family.

I keep fighting with my dad because I think we have different ideas of what “family” is.

My dad thinks that family is people you are related to by blood who are obligated to take you in if you are in trouble. He sees them like Social Security. You show up once a year to let them know you are alive so that if you are at a point where you might not be you can show up with your hand out and expect to be taken care of.

To me, what I observed, is that family are your social circle and your safety net. Family is people you want to spend time with and who you want to help if they’re in trouble. My dad has no interest in a meaningful relationship with any member of his or my mother’s extended family and he assumes that the blood tie is enough to fulfill this goal.

So What Does this Have to do with Networking?

I’ve noticed that some people are taking the wrong approach to networking.

Many people think that having several hundred LinkedIn connections is a network. It isn’t.

Jeremy Sherman was talking at the mini-360iDev in Greenville last year about how he networked with a journalist he hoped would feature him in a piece for his magazine. The only reason this tactic worked was because Jeremy actually made friends with this person. They liked one another and it was a real, meaningful relationship. He made it clear it wasn’t a mercenary tactic, he just really wanted to befriend the guy and that it worked out because he treated the journalist as a human being and not an opportunity.

All of the opportunities I have had have come from having meaningful relationships with people in this community.

It means a lot to me that the Kleins, the Remsiks, and the Wilkers have given me the opportunity to speak at their conferences. I like all of them as people very much. If I didn’t get to speak at 360iDev in two weeks (buy your tickets!), I would still like the Wilkers very much and would have found a way to go (but I am glad I didn’t have to).

I made friends with Chris Adamson because I liked the work that he did. We hung out at Anime Central the last two years because we were friends and we both had a mutual enjoyment of anime.

If I had gone into my friendship with him with the agenda that I was going to get something out of him, our friendship would never have materialized. People can sense users a mile away. Don’t be a user.

I am at a point right now where if I lost my job this afternoon, I have a large number of people I would go to for help, not just to find another job, but just because they’re friends who I think can give me advice and comfort about what to do. I have a lot of people in this community that I consider to be close friends and confidants and it makes my life and career richer for having a meaningful relationship with them.

Networking is about building meaningful relationships with people. It’s about seeing them as people and spending time with them even if it doesn’t immediately get you anything. It’s about finding people you genuinely like and who genuinely like you. If you go to one conference and meet someone once and never follow up with them, then I am sorry, they are not a connection in your network.

If you’re going to go to the expense and time of attending a conference, make the most of it. Meet as many people as you can. Find people who like the same things you do and keep in touch with them. You can’t pick your family, but you can pick the people you choose to be connected to.

Property Lists And User Defaults in Swift

I have written a bit about some of the work I am doing right now. Sadly, for most of this calendar year I have worked with Swift very little. I spent a lot of time working with some old open-source C libraries. Trying to yank my brain from the C precipice and trying to force it back into thinking in Swift.

My boss Brad Larson has been diving into the deep end of the Swift pool and bringing a bunch of treasures up from the bottom that I never would have considered. I am taking one of these treasures and examining how it works and what issues in our code it solves. I am hoping that by taking an elegant solution that many of us might not have thought of that we can all start thinking outside the OOP box.

The first part of this blog post is talking about some Cocoa concepts you probably are familiar with if you are not a new developer. Since I am a new developer, this stuff was new to me and interesting, so if you’ve been programming a while, you can probably skim this first section.

NSCoding, Property Lists, and Objective-C

The main piece of software we utilize at my company is SonoGuide. This is a piece of software that controls our robotics systems. Our systems print very minute amounts of liquid on a very small scale. Our positioner systems must be very precise. Our systems are rated to be accurate down to five microns. For those who haven’t worked with measurements for a while, that is 0.005 millimeters. You know, those super tiny increments on the ruler that are smaller than the tip of your pencil. So we are dealing with things that are incredibly small.

One of the pieces of functionality that we want our users to have is to be able to save coordinates. Since our systems are so precise and measure such small distances, it would be rather annoying for them to have to remember where their solution wells are in relation to the substrate they are printing on. We would like these positions to persist even if the user turns off the computer for the day and comes back next week.

It makes the most sense to keep these locations in the NSUserDefaults, which is a Property List. Property Lists, or plists, are NSDictionaries that contain different types of data. They can include arrays, strings, numbers, and even other NSDictionaries.

So we need an array of coordinate objects that we want to store in the NSUserDefaults that we are able to store and retrieve when necessary.

The way we, and everyone else, accomplished this back in the before time was as follows:

Serialization and NSCoder

While we’re still in the Way Back machine, do you remember that there was a period of time where if you looked at crash logs, you got weird hexadecimal values for where your app crashed rather than a nice, neat, human readable line of code?

The process of turning that value into a line of code is called “serialization.” The best mental explanation I have for serialization is the explanation that Mike Teevee uses to explain what television is in Willy Wonka and the Chocolate Factory:

You photograph something, and then the photograph is split up into millions of tiny pieces, and they go whizzing through the air down to your TV set where they’re all put together again in the right order.

Except instead of a photograph, you are using data and instead of it whizzing through the air, it’s whizzing through your hard drive in an area where it can be persisted and reproduced accurately.

We used the archiving functionality built into Cocoa to do our data serialization. Our persistence needs were not large enough to justify using Core Data and I think it’s possible that Core Data didn’t exist when the project was created. For a good background on choosing how to persist data, read Mattt Thompson’s post on the topic.

Archiving functionality has a few pieces. It has NSKeyedArchiver and NSKeyedUnarchiver for pushing and pulling the data. It also has NSCoder, which is where we, as the programmer, specify how to encode and decode our data.

NSCoding is a protocol that requires two methods to be written to conform to the protocol: encodeWithCoder and initWithCoder.

We implement the initialization protocol in our Coordinate class:

#pragma mark -
#pragma mark NSCoding protocol methods

- (void)encodeWithCoder:(NSCoder *)coder;
{
    if (name != nil) {
        [coder encodeObject:name forKey:@"name"];
        [coder encodeInteger:x forKey:@"x"];
        [coder encodeInteger:y forKey:@"y"];
        [coder encodeInteger:z forKey:@"z"];
    }
}

- (id)initWithCoder:(NSCoder *)coder;
{
    self = [self initWithX:[coder decodeIntForKey:@"x"] 
                      andY:[coder decodeIntForKey:@"y"] 
                      andZ:[coder decodeIntForKey:@"z"]];
    if (self != nil)
    {
        self.name = [coder decodeObjectForKey:@"name"];
    }

    return self;
}

With this code we are simply encoding the name of our coordinate object as a key and then adding the x, y, and z locations as values.

This takes care of our issues with serializing our coordinates. The coordinates are converted into NSData, making it nice and easy for us to move it from one place to another.

So cool, we have encoded our coordinate and we can extract it by decoding it. Huzzah.

So how do we decode our coordinate?

Our coordinate is stored as NSData. We have to reach out to our NSUserDefaults, look for anything encoded with the key “savedPositions”, decode it, and bring it back here.

NSData *dataRepresentingSavedPositions = [[NSUserDefaults standardUserDefaults]
                                           objectForKey:@"savedPositions"];
if (dataRepresentingSavedPositions != nil)
{
    NSArray *oldSavedPositions = [NSKeyedUnarchiver unarchiveObjectWithData:dataRepresentingSavedPositions];
}

If you are interested in learning more about the NSCoding process, read this amazing blog post by Mike Ash.

Problems With This Approach

If you have learned anything about archiving data, this is the method you were probably taught. I did this myself while I was working through the Big Nerd Ranch guide to iOS programming. This is the standard. What is wrong with it.

Quite a bit, actually.

NSData isn’t inherently safe.

NSData is basically grey goo. It is a large clump of bits and bytes that have things fed into it and pulled out of it.

In our dataRepresentingSavedPositions we are simply pulling out any values associated with the key savedPositions. We are trusting that the data we are pulling is the kind that we want. It’s possible that our users have gone into the defaults property list and changed something. It’s possible that a hacker has gone and replaced one of our coordinates with a malicious executable file. We don’t know. There are no safety checks to ensure that none of these situations occur because when we serialized our data, we lost its type information. We’re living on a prayer here.

NSCoder can only be applied to an object inheriting from NSObject.

The way we structured our Swift code, we take advantage of the enhanced features of structs and enums. Our structs cannot comply to the NSCoder protocol because the only things that can are objects that inherit from NSObject.

In Mike’s article about implementing NSCoding, he mentions that if you want to encode a struct, you can’t encode it directly because it breaks. You need to break a struct down into its base components if you want to store and serialize them.

Since Apple has made it rather clear at this most recent WWDC that they would like us to start moving away from making everything an object, it doesn’t make a lot of sense for us to completely rewrite our code to start making our coordinates objects rather than structs.

Basically, NSCoder is build around the idea that you will only work with and encode objects, which is not how many of us program anymore.

A Swift Approach

Since we can’t really do our serialization and archiving the way we did them in the previous version of the code, how did we approach and solve this issue?

I will go over the various components of this code.

Structs

Right off the bat, we are creating our coordinate as a struct and not an object:

struct Coordinate {
    let x:Double
    let y:Double
    let z:Double

    init(_ x: Double, _ y: Double, _ z: Double) {
        self.x = x
        self.y = y
        self.z = z
    }
}

Since we know from earlier that we can’t associate NSCoder with our Coordinate struct, we need to figure out another way to deal with it. We used a protocol.

Protocols

protocol PropertyListReadable {
    func propertyListRepresentation() -> NSDictionary
    init?(propertyListRepresentation:NSDictionary?)
}

Since property lists are just NSDictionary objects, we need to make sure that anything that conforms to PropertyListReadable is able to create and take in NSDictionary objects.

Since we can now extend structs with protocols, we are able to take the PropertyListReadable protocol and extend the Coordinate struct:

extension Coordinate: PropertyListReadable {
    func propertyListRepresentation() -> NSDictionary {
        let representation:[String:AnyObject] = ["x":self.x, "y":self.y, "z":self.z]
        return representation
    }

    init?(propertyListRepresentation:NSDictionary?) {
        guard let values = propertyListRepresentation else {return nil}
        if let xCoordinate = values["x"] as? Double,
               yCoordinate = values["y"] as? Double,
               zCoordinate = values["z"] as? Double {
                   self.x = xCoordinate
                   self.y = yCoordinate
                   self.z = zCoordinate
        } else {
            return nil
        }
    }
}

The propertyListRepresentation function works under the assumption that a Coordinate instance was already able to be initialized with the correct number and types of parameters. This function goes through the Coordinate instance and sets key-value pairs for each of the axis and returns an NSDictionary. This function allows you to take any and all Coordinate instances and format them in such a way that they can be saved to the NSUserDefaults.

There are some situations where you want to go the other way. You have extracted an NSDictionary from the NSUserDefaults and you want to break it back down into a Coordinate instance. Since you can’t be certain that the data you are pulling from the defaults is in fact a completed coordinate, you need to use a failable initializer. You also need to make sure your return value is optional because if you were pulling data associated with a string you don’t want to crash your app by trying to process nonsense.

In our first line of code, we are implementing the shiny new guard statement. Since many of you may not have had time to dabble with guard, let me walk you through how we are using it and why.

Our goal with this initializer is to create a Coordinate with values we have extracted from the user defaults. Before we try to set each of our axis to a value, we want to make sure a value even exists. That is where guard comes in.

We are checking to see if our optional parameter was passed in or if we have nil. If we have nil, we don’t want to have to go through a bunch of conditional logic to verify that yes, we are doing nothing with our value. A guard statement only executes a line of code if the condition is not met. We want to return nil if we know that no parameters were passed in, so we can cut to the chase and do that immediately at the beginning of our block of code.

Once we have established that our NSDictionary was not nil, we now go through each value in the dictionary to make sure it correlates to a specific key. If at any point we encounter a key that does not have a value, we kick out of the whole thing and return nil.

By using a protocol to implement this functionality, we are able to specialize and reuse these concepts for other value types in our software. Before, we would have had to make a superclass or a delegate with methods that were required to be overridden by the subclass. By allowing structs to conform to protocols, we are able to specify functionality that we need in multiple places but with different implementation.

Map, Filter, and FlatMap

It would not be a shiny Swift blog post without the obligatory section on the functional features of Swift.

Just to clarify where we are at at this point in the code. NSUserDefaults is an NSDictionary where the key is the name you assign to label what you want to store. In our case, we want to store saved coordinates, so our key is “savedPositions”. The value is an array. The array can contain any object. Our Coordinate is not an object because it’s a struct, which is why we convert it to an NSDictionary. So, in theory, our NSUserDefaults should have a key-value pair where the key is “savedPositions” and the value is an array of NSDictionary objects that represent Coordinates. Simple, right?

Wouldn’t it be really cool to be able to filter through the array we pull from the NSUserDefaults to make sure we have an array of only the objects of the type we want? Sadly, there isn’t.

Of course there is. If there wasn’t then either that sentence wouldn’t be there, and or I would be a sadist. The jury is still out on that last conditional.

func extractValuesFromPropertyListArray(propertyListArray:[AnyObject]?) -> [T] {
    guard let encodedArray = propertyListArray as? [NSDictionary] else {return []}
    return encodedArray.map{T(propertyListRepresentation:$0)}
                       .filter{ $0 != nil }
                       .map{ $0! }
}

In the extractValuesFromPropertyListArray function, we are accepting an optional argument of an array of any object and returning an array of our generic return value. We also are specifying our generic return value must conform to the PropertyListReadable protocol.

The first thing we need to do is make sure we actually received a value. If we didn’t, there is no point in filtering an array that doesn’t exist. Our first line of code checks to see if we have a value and if that value can be cast to an array of NSDictionaries. If we don’t or we can’t, we return an empty array.

If that passes, we go ahead and filter the array. We use the .map function (which iterates through an array, applies a function to it, then creates a new array from the results) to run each value through our propertyListRepresentation initializer we created in our Coordinate extension. The propertyListRepresentation either returns an optional Coordinate or a nil.

We then apply a .filter to our results. We check to see if each item in the array is not nil. If it is nil, we throw it away. We then create a new array of just optional Coordinates.

Finally, now that we have ensured that we don’t have any possible nil values, we use another .map to unwrap each value and return and array of Coordinates (or any other structs we extend with the PropertyListProtocol).

This is really inefficient.

The function extractValuesFromPropertyListArray was refactored to the following:

func extractValuesFromPropertyListArray(propertyListArray:[AnyObject]?) -> [T] {
    guard let encodedArray = propertyListArray else {return []}
    return encodedArray.map{$0 as? NSDictionary}
                       .flatMap{T(propertyListRepresentation:$0)}
}

It was a real shame in our previous version of the code that if we had an array of mostly NSDictionaries, but if some stupid NSData object (which could be a malicious program) somehow snuck into our array, we had to throw away all of our other valid values. Since we’re going to filter through our results later anyway, we just want to verify we have an array of anything.

Since we don’t filter for NSDictionaries in our first line of code, we need to move the filter to our second line. Now our first .map statement is checking to see if each item can be cast the an optional NSDictionary. If it can, it gets added to the new array. If it can’t, it gets kicked to the curb.

Our previous code had a convoluted setup to be able to apply a function, filter out the nils, then unwrap the coordinates. This is a common enough thing that there should be a more concise way to do this. There is, and that is using .flatMap. Flat Map does exactly the same thing as our previous three chained functions in one handy dandy function call. Huzzah!

Saving to Defaults

We have one last part left to our property list loading and unloading. We’ve verified that everything we are extracting to the defaults is safe. We now have to verify that everything we are sending out to the defaults is safe.

One last little block of code:

func saveValuesToDefaults(newValues:[T], key:String) {
    let encodedValues = newValues.map{$0.propertyListRepresentation()}
    NSUserDefaults.standardUserDefaults().setObject(encodedValues, forKey:key)
}

For our parameters, we are taking an array of values that conform to T:PropertyListReadable and a string value to use for our key.

We’re creating an array of encoded values by taking the array parameter and mapping each one using the propertyListRepresentation function to turn it into an array of NSDictionaries. We then run the result through the setObject:forKey function associated with the NSUserDefaults.

Conclusion

I created a playground that contains all of the code I spoke about in the second half of this post.

When Brad showed me the extractValuesFromPropertyListArray function, it made my head explode. I saw the .flatMap() function and the guard statement, I felt stupid and inadequate. I felt despair that I would ever be able to come up with this stuff on my own. I can look at code and kind of grok what it means, but reading and understanding something are different than actually coming up with it.

After a while of struggling with the code, I realized I was asking the wrong questions about it. Rather than asking “how” it worked, I should have been asking “why” it was written that way. I talked to Brad about how we were dealing with the user defaults in the original code. He told me about the issue he had with it that I detailed in the first half of the post.

That is when a lot of this stuff began to click into place for me.

We don’t have this complicated code because we’re trying to be clever and use all the new toys in Swift. We are doing the code this way because it solves a problem that we had that could not be solved with Objective-C.

We could have used a “for-in” loop instead of the .map() function. We didn’t have to use .flatMap(), we had a longer implementation of it.

I have been approaching learning Swift all wrong. I was trying to take concepts like currying and trying to find ways of cramming them into my code so that I could understand how they worked. Our code is elegant because it had a specific set of problems it needed to solve that either were not solvable any other way, or would have resulted in more lines of code that would have taken more time to run because it wasn’t optimized.

For me, I took two lessons from this:

  1. Instead of spending more time thinking about clever ways to use shiny new features, I should spend some time thinking about what problems I had to solve.
  2. Just because my code “works” doesn’t mean it can’t be better. There might be “easy” ways to get something running, but there might be better, more elegant ways to write your code.

Yes, it’s overwhelming keeping up with all the new language changes and feature out there, but there can be great features that can make your code better that you never discover if you just decide your code is done once it compiles.