Proper reentry for developers

I’m writing a book about successfully working from home; click here if you want to know when it is complete.

If you are a developer or anyone else that does high-concentration work (writer, artist, maker or orange juice) you have to reenter the world at some point after your workday is done. Those of us with families can probably all think back on a time when we were writing software like mad only to see that it was 6:30 and thus time to check-in, logout, and go play with our kids. Only for the first 30 minutes to an hour we weren’t engaged with our kids and we were impatient with our wives.

In fact I’ve met those that appear to treat the people in their lives like computers – demanding fast responses and barking instructions at them while getting annoyed at how unreliable they are. After hours of doing development work you need to make sure you separate effective methods at work and at home.

Why are we jerks? Aren’t we working to support our families? Wouldn’t we rather hang out with them all day rather than sling electrons to the highest bidder? Well I’ve had trouble with this and I think it’s because the pace of both activities are just so different you have to be intentional about ‘reentry’.

Differences

Writing software means that you are in almost complete control of what is going on – your computer hums and obeys, you listen to whatever you want, you look at whatever you want. Your software if it has bugs are your bugs so you can’t yell at anybody but the cat (side note: recommended). In short you are in charge.

In addition you can control how much you have going on, and most of us choose to dive deep into the waters of NADD and have caffeine, music, and multiple threads running while we work. If you were to watch a video of me working you would think my job was to load test Windows 7. This is a high stimulus environment and its fun and addictive. You feel powerful and respected.

Enter family: you do not control what is going on. Your music is suddenly different. You do not feel in control and can’t Alt-Tab away from a slow-loading page. If your two-year old wants to start off a conversation by saying “Daddy daddy daddy today we today we daddy daddy today at school we daddy daddy today we went daddy oh then she said that the doggie…” then you should act like a normal human being and listen.

So, my tips for proper reentry.

Enter the vacumm chamber

Twenty minutes before you get home unplug as much as you can. If you drive home don’t check your email once you walk out the door and try to listen to different music (or ideally none at all or talk radio) to separate. If you work at home close up everything like you are about to stand up but don’t walk into the rest of your home until you take a few minutes and do something physical – sit-ups, pushups, Christopher Walken-impression, hiding under your desk, etc.

Begin reentry

When you get home greet everyone and go change clothes. This signals to everyone that Mr. Rogers is awesome and his legacy lives on forever and that you are switching from one thing to another. If you work from home I’d say change something even though you are probably wearing the most comfortable thing you have on (i.e. your moo-moo). I normally either put on or take off my cape (depending on what happened during the day).

Turn off your phone; like hit the button. During the day you are probably checking your email all the time and if you are like me you use your phone for this. Guess what – you aren’t working! So don’t check it. If you must go put it somewhere that you can hear it if someone calls but not close enough to see a little light blinking telling you that you got something that doesn’t matter such as a new Twitter reply or a virus. Unless your job description involves the phrase “nuclear launch codes” or “creator of Chipotle restaurants” let’s face it – your job isn’t that important and you should enjoy your rest.

Get some perspective

On the days when you can’t get this right: you have too much to do, the kids are crazy, the significant other is crazy, everything is chaos in both parts of your life you need to gain some perspective to snap yourself back to reality. I have a few, but here is one: there are many immigrants in this country who work more hours than you, for less money, doing harder work, in a foreign land, for the sole purpose of sending money to their families who they rarely get to see.

I’m writing a book about successfully working from home; click here if you want to know when it is complete.

How to work from home without going insane (purple monkey dishwasher)

I’m writing a book about successfully working from home; click here if you want to know when it is complete.

So you’ve decided to work from home. As a rookie-veteran of working without a traditional office for one year I’m here to tell you that it is the greatest and worst thing that can happen to your work life – much like being transferred to a glitter-packing facility. What follows is a quick two minute guide of what you need to know before you take your pants off and turn up those old Hootie and the Blowfish albums.

Interruptions

Working from home completely changes your interrupt cycle. At a typical desk job you are interrupted constantly due to meetings, cake feasts, fire drills, people coming over to tell you about what the lake was like on Saturday, daydreaming about tripping said individuals, etc.

When you work at a location of your choice you can control what distracts you. If you want to work for 4 hours and not use the bathroom you can do it; if you want to work with 2 lbs of nachos taped to your face like a beard while wearing a sombrero filled with nacho cheese for snacking you can do this. Most people think they will be far more productive due to being able to control large blocks of time, but I found that the experience was quite jarring.

What you will realize is that outside of your normal distractions your body has learned to not focus for very long on anything. In my case after years of working in an environment where I was constantly interrupted I couldn’t focus on anything for more than 20-30 minutes (about the longest free period I had on average). I would internally interrupt myself constantly: twitter, facebook, doodling, trying to clean nachos that fell onto the keyboard from my nacho beard, calling the manufacturer of said keyboard after the ‘s’ key stopped working, writing a strongly-worded letter calling the manufacturer a bunch of “lazy jackae”, picketing outside their headquarters, etc. Typical stuff.

When you work in an office you don’t allow yourself to constantly be interrupted internally – you simply can’t watch every video that looks funny, you can’t read each article on The Morning News everyday, you can’t keep up with Hacker News like you think karma points are worth money.

The way to get over this is pretty simple – practice. I for one spent about a month making love to The Pomodoro Technique (meta: learning to make love using this technique is experimental and not recommended by most doctors) but it worked quite well for me in training my brain to recognize interruption events and stop them. Now I can go over an hour without eating a nacho.

Pressure

When you have a ‘bad’ day at a normal job you still feel a sense of accomplishment – you drove to work, you drank some coffee, you attended a few meetings, you chatted with some co-workers about how little progress you were making – you did some concrete tasks.

Working from home alone you have days that you feel like you get *nothing* done. As soon as you get going you are interrupted, you spend a few hours working on something that you later scrap and start over, you can’t figure something out. These days happen in an office but when you are alone with them they create extreme emotions. The thing you need to remember is that one day like this can be followed by a sugar-rush Work-From-Home monster day: a day in which you get as much done in a day as you remember getting done in a week at BigCorp. An entire feature imagined, mocked up, coded, then just plain mocked, debugged, re-tooled, polished, stabilized, and then shipped.

Crippling Depression – ride it like a wave

If you work at home for long enough away from other real people you will be surprised how much you will miss the interaction. The annoying “did you see the game?” water cooler talk and “OMG Its Friday!!” chit-chat that used to make you want to hide in a conference room is actually a pretty effective social convention to avoid The Question: “Why am I working right now when I could be doing XYZ?”.

While working you will have many moments when you will think things like:

  • I work from home now, I could go take a walk – right now!
  • I work from home now, I could go eat some yogurt – right now!
  • I work from home now, I could ride a bike – right now!
  • I work from home now, I could watch The Wire – right now!

In the spring these thoughts are tough and you will stare out the window and cry a single slowly descending tear before turning back to your semi-colon delimited job and push through. In a normal office you don’t think about the difference between working and playing hooky because the threat of getting fired for playing Grand Theft Auto III at your desk is very real.

In addition you will need to take steps to keep in touch with others in your field less you become a Work-From-Home monster like many that I have met. Signs you are becoming cripplingly depressed without realizing it from working from home:

  • You see a former co-worker and talk for 20 more minutes than would be normal. Even after they have gotten up and left the stall you continue.
  • You are way too active on twitter, facebook, g+, etc. and constantly send videos to your friends like you work at Tosh.0.
  • You watch TV instead of listening to music and you talk back to the characters.  You think you hear Ferb talk back to you.
  • You drink Diet Pepsi just to let the pain make sure you can still feel something.

If any of these things happen put some pants on and go to a coffeeshop.

The greatest thing about working from home is your kids. They are also the worst thing.

This might be a personal problem as:

  • I work on the same floor of the house as my kids typically play.
  • My wife currently stays at home with the kids.
  • Before I worked from home I never listened to music while working (due to a deep-seated and irrational fear of being caught singing out loud a Jon Secada song)

I was very stressed with the noise of my kids and the general stress that kids cause when you do concentration-based work. I felt like a bad Dad because I would have to tell them 8 times that I wasn’t “done yet” but was just coming out to go to the bathroom, refill nachos, etc.

Once I realized that working at home meant more time with my kids I just mentally substituted the time spent in the car with time on the floor with them, and my stress melted away awkwardly like reheated queso.

Less informal communication means more organization

I’m an organic and an improviser. I’m not naturally organized. But working from home in the absence of informal methods of communication means that you need to have prepared the following:

  • a to-do list that you can share (workflowy, RTM, etc.) in less than one minute
  • a general daily plan that you can recite at beginning, middle, end of day.
  • a weekly plan of what you want to get done and what you did last week
  • a plan for when you will meet with the client, boss, parole officer next

Enjoy it

I know that at some point my work from home life will be put on hold or go away. And I decided when I started that I wanted to do a good job and to enjoy it enough that when I looked back I wouldn’t say that I regretted much. To remind myself of this I wrote “San Diego means a whale’s vagina” on my whiteboard (since this kinda isn’t the sort of thing you can do in a normal office).

So go – enjoy it. And please just go take a shower.

I’m writing a book about successfully working from home; click here if you want to know when it is complete.

Great discussion, as always, on Hacker News.

Republished on Lifehacker.

Obstacles adults face in creating

All children are artists. The problem is how to remain an artist once he grows up.
— Pablo Picasso

I am amazed at my daughter’s productivity. She makes things at an astonishing rate – pictures, ideas, animals, pretend situations, etc. All day, everyday. Really all night too – she wakes up and tells me about dreams that she has had that blow me away. Then she sits down and draws a handful of pictures while telling me a story about her pet elephant as she makes up words with her cereal.  And then I go to work and can’t think of a single idea.

What can I learn from her?  And after thinking about it for 27 seconds I’ve realized: she just avoids 3 common obstacles to creation that all adults face.

#1 Thinking you need more skill before you start.

Kids don’t sit down to fingerpaint and think ‘I’ve never taken a class on this, I don’t know how to do this’.

#2 Being afraid of bad ideas, ‘wasting time’, of being mocked.

Praise decreases as we get older. Part of why kids create is that they are encouraged in most things they do. Adults rarely feel their work praised but often see it ignored, mocked, or dismissed as being a waste of time. (Skeptical of this? Write a blog, make a hat, or draw a picture and put in on your cubicle wall and then ask people what they think of it)

Something inside you has to value the act of creating in order to just ignore this type of feedback. You have to value the act not the result before you can focus on doing the act more.

In terms of fear of bad ideas I think the thought chain looks like this:

Hmmm -> I can’t think of any ideas for this t-shirt -> Cause I’m not creative

or

What if we put a bunny on it? -> That sounds stupid -> I’ll be made fun of since bunnies are girly -> Forget it

You think children think like that?

#3 Evaluating ideas as they are generated.

If you combine the first two and make the process more efficient you end up with what I think is the most common problem with people being able to imagine as they grow up – they have gotten very good at very quickly dismissing what their imagination leads them towards. This ‘clogs the pipe’ so badly that they simply stop generating ideas – its more efficient to just have only safe ones.

The trick is to separate the act of creating from evaluating it for dismissal. As you are making something you are constantly evaluating it and improving it, but this should be done by your taste and not your experience. And this difference is the difference between children and adults.

Have you ever sat in a brainstorming meeting with people that don’t believe that they are creative? (i.e. have you ever pulled your own eyelashes out with pliers?) They normally start with silence until somebody starts throwing out really bad ideas and then people don’t immediately criticize them. Smart organization focus on *not* evaluating ideas while they are being made.

Generating ideas good or bad will always be a good thing to practice and bad ideas when mutated, combined, or twisted sometimes become really good ideas. But only if you don’t listen to the little voice telling you that you don’t know how, you will be mocked, or that the idea won’t be good.

Exception (Mis)Handling

Exception handling was originally created to try to give developers a way to separate out error handling so that it wouldn’t clutter up and distract from the core functionality trying to be accomplished. When done well, exception handling can provide a clean way to instrument and separate truly exceptional conditions from the core flow of your methods as well as a way to prevent nasty crashes and untraceable bugs. When done badly, exception handling can be misused for decision making, masking errors and bugs, and distracting developers from doing real work.Go read these when you have time, and you have time if you are reading this – admit it.Chapter 19 of CLR via C# and Guidelines: Exception Handling.There is not a lot that can be said that isn’t said here about .NET exception handling that isn’t in the resources above, but I’ve picked up on a common anti-pattern that stems from a misunderstanding of what exception handling is. I call it the “safety-net catch”, and it goes a little something like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public bool Import()
{
	bool isSuccess = false;
   	try    
	{     
		if (SomethingIsWrong())         
			throw new ApplicationException("Start panic sequence now.");
	        bSuccess = DoSomething(WithThis, AndThis);     
		foreach (string databaseThing in theDatabase)        
		{            
			if (bSuccess) bSuccess = DoSomethingUseful(databaseThing);
	        }    
	}    
	catch (Exception ex)    
	{        
		PublishException(ex);        
		isSuccess = false;    
	}    
	return isSuccess;
}

In this example, DoSomethingUseful, DoSomething, and most likely PublishException all have this same pattern of a ‘catch all’ at the end. We aren’t getting much benefit from this style of exception handling as it merely serves to make sure that this method always returns bSuccess so that execution should continue with any failure.I think it would be easier on everyone if this code was changed to simply not handle exceptions that it can’t actually handle. The top level threads of your application should have a “catch all” that publishes the exception, and then displays a nice message for the user in the case of a web application. So if you want to fail, just let it fail if you can’t recover from it. The contract of the method Import above doesn’t say that it doesn’t throw exceptions – if it can’t do its job it should throw or allow an exception to bubble up.There are cases where you don’t want the code to break out in the case of any exception, but these are rare. In the case of row level handling where we are parsing a file and you don’t want row to ruin the whole file you can simply move exception handling down to that import piece. In this case non- exception based mechanisms can be used or you can throw a custom exception type or an exception with well understood semantics like InvalidOperationException or ArgumentException.Please do:

  • Throw an exception in a method if you can’t do the method’s job. If you don’t know what the method should do because it does 23 things, 18 of which can happen if it isn’t given a valid value for AccountNumber, refactor until you have 23 methods, one of which throws InvalidArgumentException when it gets an invalid AccountNumber.
  • Only do a ‘catch’ if you are going to handle it (maybe the syntax should say handle). Just publishing or setting a variable doesn’t count in the pattern above.
  • If you for some reason catch and rethrow (like if you want to add to the exception object), do a throw and not a throw origEx to keep the call stack.
  • Remember that your most common ‘exceptional condition’ might be a database timeout or other database exception (System.Data.SqlClient.SqlException) and is not an ApplicationException but most likely can’t be recovered from anyway.

Please don’t do this:

1
2
3
4
5
6
7
8
9
10
try
{
	bc.Save(o); 
	DB.UpdateProcessFlag(conn, Util.GetInt32(dr, "Key"), 1);}
	catch
	{ 
		//Error on save, so mark this one as errored. 
		DB.UpdateProcessFlag(conn, Util.GetInt32(dr, "Key"), -1);
	}
}

There are many reasons that this .Save() could fail, and a SqlException or (ObjectReferenceException on dr) are going to be badly mishandled here. If you find yourself feeling like you need to use the try/catch mechanism for this sort of stuff perhaps take a step back and think about how to handle it in terms of design.And please don’t do this unless you like hearing the sound of me dying inside. (Use the TryParse pattern instead)

1
2
try { o.Something = -aNumba; }catch { o.Something = 0; }
try { amt = Util.GetDecimal(dr, "FieldName"); } catch { amt = 0; }if (amt == 0) return;

Key considerations for your next development job

As a developer, your basic job is to create things. Since the world needs software in every industry you might think that one is the same as the next, and you’d be shamefully wrong. Outside of the obvious questions you should ask yourself when looking for your next gig – how sharp are the coworkers, how good is the tech, how hard are the problems, how good are the tools – you should also ask: “Who are we working for?” It turns out that who you produce for can more directly impact how much you like your job than you might think.

Internal* vs. External client

Internal clients don’t matter as much as external ones. Yeah I said it, wanna fight about it? Working for a bank on their internal accounting software is not the same as working on banking software that is sold to banks. Period, close bracket, EOF. The reason for this is that one is a profit center with real financial pressure, and the other is a cost center, with pressure to simply exist cheaply. A profit center has direct competitors that you sometimes have to react to, but a cost center rarely implements new product due to hearing that an internal customer at another company is happy.  The internal vs. external switch plays itself out in multiple subtle ways:

Rate of Change

A profit center tries multiple things, watches competitors to match features, explores new lines of business, etc. A cost center does not take much risk, and thus is more setup for small improvement or the support of company growth.

Rate of spending

Another way this plays out is in lack of budget flexibility – since a cost center is under pressure to lower costs their budgets are smaller and less innovative. The type of managers that run these organizations are the special type of demon that is good at finding ways to save money – like on hardware or crappy coffee.

Rate of Respect

In a profit center the business leaders interact with the technical leaders and producers enough that they begin to understand their importance. Over time a mutual respect grows and is a healthy team behavior. In a cost center at times the cost center is in a servant position and the IT functions are not held in the same level of respect.

Producer vs. Maintainer

There is another subtle difference in “software developers” at times that can play out in affecting you position. Some people build tools and processes and some people build deliverable product. In the software realm the tools can include continuous integration modules, deployment tools, operational helper tools, code generators, etc. Product includes things that directly sell outside your organization. If you are a developer working on the toolset *primarily* you are secondary to those working on the end product – you are in effect serving an internal customer.

Deadline driven vs Shame-driven

When we interview someone we always ask how the end game of projects work – “Do you work off of deadlines?”, “Who sets these deadlines?”. Many internal customers have false deadlines because there is no competition – are they going to go use another internal accounting department? The same fire does not always exist in those working in internally-facing companies. Just because your coworkers are smart this doesn’t mean they have any hustle.

Industry and Economy

The industry that you are building solutions for can matter because the level of tolerated innovation differs across industries and product categories. My first full-time programming job was working on an audio-dispatching call center product that was sold to air traffic controllers and 911 call centers. The sales cycle for this product was very different than other industries – if a client saw a demo and a single thing went wrong they would typically say: “We will reevaluate changing our product in 5 years, get back to us then”. This is obviously different than the change cycle for a web-based project management tool that might receive changes every two weeks.

Customer distance

How “close” you are to the customer matters as well whether that customer is internal or external. While only some developers are interested in directly speaking to customers, the dev team’s distance to the customer can affect whether or not what they are building matters. As a producer you should care very deeply about whether you are building the right thing.

* Internal clients means full-time – if you are working on a project for an internal client the effects are more minor. Most of what is mentioned above is when you wake up everyday to a world of internal client demands only.