Management by walking around

Part 3 in a series on managing programmers

The third installment in this series is about something I learned well before I got into management. In fact, it’s probably the reason why I got into management at all:

Get up out of your chair.

As geeks we’d rather just sit there. Sit in our chairs and send yet another email and hope enough folks read it. We spend a whole hour crafting a brilliant treatise on an Important Topic and assume that our written words alone are motivating enough to get people to do what we need them to do. And we hope (in vain) that people will read our words carefully, reflect deeply, and return the favor by drafting a well-written response of their own.

But when it comes to managing people email simply doesn’t work as well as we wish it did. It’s often the wrong tool entirely. You know this as well as I do. People simply don’t read your emails carefully. Or they miss it entirely. Or the message gets to them too late. Or too soon. And even when they do read your email, people can almost always manage to misinterpret the tone of your message and you end up spending even more time clarifying and apologizing and re-iterating. Et cetera.

In my experience, the only thing that does work is to do something that is entirely unnatural for most in the world of high tech: Get up out of your chair and practice some “MBWA“. MBWA stands for “management by walking around“. It means you go and walk over to somebody and actually engage in conversation. Talk to them. Talk first about the weather or their kids or whatever they’re working on at the moment. Then transition the conversation to what you need to talk about, or just drop in your request casually at the end. And sometimes, just like magic, you learn things without even having to prod. It goes like this:

Tammy sitting reading email. Manager enters, stage right.

Manager: “Hey, Tammy. What’s new?”
Tammy: “Just reading the latest missive from the client. They’re being a little less insane than usual today.”
Manager: “Nice! Always good when sanity prevails, eh?”
Tammy: “Yeah, absolutely. We can use a little bit of a break after yesterday’s server issues.”
Manager: “Wow, really? I must have missed that somehow. We had server issues yesterday?”
Tammy: “Yeah. It turns out the new audit trail feature caused our logs to fill up and we ran out of disk space.”
Manager: “Ouch! But yeah, that makes sense. You’ve got it fixed now though, right?”
Tammy: “Yep. We’re purging logs every 30 days now.”
Manager: “Good deal. Client seems happy?”
Tammy: “Sure. They seemed to like that we responded so quickly.”
Manager: “Excellent. Thanks for jumping in there!”

Manager exits, stage left. Elapsed time: 45 seconds.

3 reasons why MBWA can make you more effective

  • It’s faster. Yes, it is. You might think you don’t have time to get up from your desk and actually go through the hassle of walking over, interrupting the person in the middle of their Facebooking, and actually talking about what needs to get done. But in the same 5 minutes it would have taken you to write an email you’re able to not only make the request but respond to questions immediately.
  • It builds relationships. Being face-to-face with someone puts you in a position to tailor your message to the individual and respond immediately to questions in a way that is most effective for that person. Moreover, engaging people one-on-one helps build the relationship — you learn more about each other. This learning is the foundation of trust, and having trust means your conversations will end up getting faster and more effective over time, especially during a crisis or when speed is of the essence. And having more face-to-face conversations also ends up making it easier for the other person to interpret your “tone” when you only send email or IMs.
  • It helps you learn and know more. As a manager you deal in information, and you’re missing out on at least 50% of the data feed if you’re not there in person. As I’ve already said, actually getting up and talking to other human beings seems counter-intuitive and at least somewhat stressful to most of us in technology. And here’s the thing: Most of our team naturally tends to avoid the face-to-face conversation as well. Yet the example above shows that it’s through the quick face-to-face interactions that we’re able to learn much, much more about what’s actually going on in our organization. Your team member may be too busy fighting a fire to send a detailed email, and maybe he’s not the type to swing by and chat either. But being there allows you to sense and prod and follow hunches, all of which end up providing you with more information, making you more effective.

So don’t just sit there in your corner office typing on the computer. As a manager your job is all about making everybody more effective by getting the right information to and from the right people at the right time. You just can’t do that with email alone. As my good friend and colleague Derek Olson likes to say: “The weeds are waist high. Sometimes you just need to stand up to see over them.”


Posted: February 6th, 2010 by Neal Enssle
Tags: , , , , ,
No Comments »

Make the call

Part 2 in a series on managing programmers

The second lesson I learned after being thrust into management was this:

Make the call.

Management didn’t confer any secret knowledge or special skills. Nothing about me had really changed from one day to the next. Except that all of a suddenly folks around me expected me to make the tough decisions.

Suddenly people would approach me with an issue. I’d listen and try to figure out what the problem was, and maybe think up a solution or two. Then I’d try to ask them what they thought about it. Hey, you’re smart. We’re paying you to know this stuff. So what do you think?

And more often than not they’d respond with something like: “Well, um, I’m not sure. That’s why I’m asking you.”

So here’s the crazy thing about being in leadership:

People expect you to lead.

I’m lucky. I get to work with wicked smart folks. So I expect them to have thought things through. And I’m usually no where near the most qualified person to make this decision. But there you have it. When the going gets tough your team members will expect you to make the call. That’s right, you’re “The Decider“, for better or for worse.

And this is a Good Thing. Making the call is, after all, why you’re there. Yes, it’s your job to make tough decisions in the face of uncertainty and lack of information and time pressure. What’s more: If you want to keep on making “the big bucks” and retain that fancy manager title then those spur-of-the-moment decisions will need end up being right more often that they’re wrong.

No pressure.

At the end of the day, being asked to make the call with insufficient information day in and day out is one of the major reasons why I see plenty of smart geeks quickly leave management roles or try to avoid them at all costs. It’s not really in our nature, because most of us technical types are information-driven. We’re type “C” in the DISC model, as the cats over at Manager Tools like to remind us. Our default mode is “ready, aim, aim, aim, aim…”. So making decisions quickly without enough information makes us really nervous.

Moreover, problems are often political. Yep, that’s part of the job too. Often the best technical answer to the problem is pretty clear to see, but implementing it means somebody’s feelings are going to get hurt. That’s why your team is coming to you. And while taking responsibility for something that might get somebody fired seems like a tough gig, it’s really the most important and best thing you can do. Really.

So if you’re a geek who’s suddenly found him or herself in a leadership role, and now everyone’s looking to you to make the decision, how do you do it?

Tips on how to make tough decisions

  • Accept responsibility for the decision. This is really important because it’s where you get a chance to exercise your role power and political power in a really positive way. By accepting that it’s your job to make this tough call, you’re helping to take the pressure off of your team member. It’s very often this pressure to make the right decision that’s brought your team member to you in the first place. And removing some of this pressure will help free them up to focus on solutions and not consequences.
  • Ask for recommendations again. It goes like this: “Hey, thanks for coming to me with this issue. It’s definitely a problem, but I’m sure we’ll figure something out. So tell me… if time/money/politics weren’t an issue, what would you recommend we do?”. So first take the pressure off them and then try to get them to re-engage. Remember, they’re usually the one with the most knowledge. And it’s always good to take another quick look around before jumping.
  • Go get consensus. If you need to get up out of your chair and ask other folks what they think about a given problem, do it! Not getting up out of your chair is probably the number one mistake technical managers make. So stand up. Call a hallway meeting. If Kevin’s brought you a problem that Jake might have insight into, then drag Kevin over to chat with Jake. And make sure you get to a point where folks agree. Consensus is important because you need this to help make the decision stand.
  • Don’t delay. Avoid the temptation of avoid putting off a decision indefinitely. Commit to a date and time. “I’ll let you know what I think by COB.” Or: “Let me check with Bob and get back to you within the hour.” It’s very natural for us to want to wait, but remember that your teammate brought this issue to you because it was important. While you sit and ponder your team is very probably at a standstill.
  • Link decisions to principles and goals. When you end up at an answer to the question or a solution to the problem, it’s a good idea to try and frame it in terms of a general principle instead of a specific solution. Choose a direction (“North”) instead of trying to specify a specific path (“42 paces to your left”). Leave yourself and your team some flexibility by letting the folks who are going to have to do the work handle the details of a specific implementation. It sounds like this: “Well, I hear you on how we’re running out of time on this project, but since we’ve all agreed that we need to do as much testing as possible even on legacy code, I’d say let’s identify the 3 most critical features and write tests for those, for starters. Do-able?”. Focusing on principles means you’re focusing on what’s reasonable based on a larger context and previously established norms.
  • Decide on plans not rules. “We must have 100% test coverage” is an empty decision without a corresponding plan for how you’ll achieve the new goal. Recognize that a decision is nothing without a plan for acting on it. While it is useful to make a general principle the foundation of your decision, it’s important to end with a plan for how the decision is going to be implemented. Here’s how that sounds: “Yes, we I agree we need to attack some of the underlying problems with the architecture. So why don’t you begin by make a list of sections of the code that already have good test coverage? Then we’ll know where we can start with the least chance of breaking things.” At the end of the day plans are more flexible, more comprehensible, and more likely to succeed in the real world than arbitrary rules.

Of course, it’s not as easy as I make it sound. But at the end of the day it’s what your team needs you to do. So make the call. It’s what you’re for as a manager.


Posted: December 18th, 2009 by Neal Enssle
Tags: , , , , ,
No Comments »

How to find the name of the current Rake task

A few weeks ago I needed a Rake task to answer a simple question for me:

“What’s my name?”

I honestly can’t quite remember why exactly the task needed to know it’s own name, but at the time it seemed important and I spent a couple hours digging about before I found out that Rake tasks are shy by nature. Or at least when implemented the way almost every tutorial tells you to implement them:

namespace :life do

  desc "The answer to life, the universe, and everything"
  task :answer do
    puts "The answer to life, the universe, and everything is 42."
  end

end

But how do I know what the name of the current task is? Well, after making a couple of random attempts (like “puts task.name”) and digging around in the very sparse documentation on the Rake homepage, I stumbled across a bit of documentation that talked about “Tasks with Actions”:

Actions are defined by passing a block to the task method. Any Ruby code can be placed in the block. The block may reference the task object via the block parameter.

task :name => [:prereq1, :prereq2] do |t|
  # actions (may reference t)
end

Ah ha! “The block may reference the task object via the block parameter.” That’s exactly what I was looking for. Adding the block parameter allows us to reference the task object itself. And the task object itself has a good bit of useful meta information:

namespace :life do

  desc "The answer to life, the universe, and everything"
  task :answer do |t|
    puts t.name
    puts t.comment
    puts t.scope
  end

end

The task now returns the following:

life:answer
The answer to life, the universe, and everything
life

The first line of output is nifty, and answers the “What’s my name?” question with the fully scoped name of the task. Given that much it’s probably not hard to return the task name in even the most deeply namespaced Rakefile. The second line is the “comment” — actually the description of the task. And the third line gets us the scope (namespaces). There are more methods available, but check teh googles for “Rake::Task api”.

So with this meta information we can do something useful like:

namespace :life do

  desc "The answer to life, the universe, and everything"
  task :answer do |t|
    puts "#{t.comment} is 42."
  end

end

Voila. And that’s probably enough meta for one day.


Posted: November 14th, 2009 by Neal Enssle
Tags: , , , , ,
No Comments »

Reading is fundamental

I was knocking about on LinkedIn this morning and saw they’ve added a new “Amazon Reading List” feature. So I took it for a spin and wrote up quick reviews for three of my new favorite books: Chad Fowler’s Passionate Programmer, Martin Fowler’s Refactoring, and Bob Martin’s Clean Code.

Then I thought: Why should LinkedIn have all the fun? So I’ve added a new page to my site called Reading where I’ve posted the reviews.

“What are you reading?” is one of my standard interview questions. And despite never having enough time for anything I do try to read a few new books on programming, management, and business every year.

Let’s see if I can keep this up.


Posted: November 14th, 2009 by Neal Enssle
Tags: , , , ,
No Comments »

How to filter Subversion logs by date and author

I keep forgetting this snippet, and then spend hours re-discovering/re-inventing it. So for the record: Here’s a bit of magic to let you filter your Subversion (SVN) logs by date and author:

svn log -vr {20091014}:"HEAD" | sed -n "/nealenssle/,/-----$/ p"

I use it in a bash shell script function that I’ve got in my .bash_profile script like so:

function svnlog {
    svn log -vr {$1}:"HEAD" | sed -n "/$2/,/-----$/ p"
}

And then call it like so:

svnlog 20091014 nealenssle

Happy spelunking!


Posted: October 14th, 2009 by Neal Enssle
Tags: , , , ,
No Comments »

Developer Day in Boulder

Yesterday Jake and I enjoyed attending Developer Day at the TechStars facility in downtown Boulder.

Highlights included meeting Chad Fowler, author of one of my new favorite books The Passionate Programmer. It turns out Chad and I are, literally, neighbors. His house in Longmont is just a few blocks away from my own.

Another interesting moment was hearing Bruce Eckel, author of Thinking in Java, express his belief that “Java is likely going to become a legacy language.” Also a bit surprising to me (though I’m sure it’s old news) was his deep love of Python — a language free from the design constraints of backward compatibility that have plagued C++ and Java. Yet another reason that Python’s next on my list of “languages to learn”.


Posted: October 11th, 2009 by Neal Enssle
Tags: , , ,
No Comments »

Why Rails?

Foraker just posted my new blog article: “Why Rails?“. The key point:

Rails lets us focus on solving business problems. At the end of the day, our customers care more about results than about any particular technology. Using Rails as a common language for our team means we can spend more time wrestling with our customers’ business problems, and less time wrestling with the technology itself. Rails lets us get started quickly, work efficiently, and respond flexibly, helping us to focus on the real challenges of designing and implementing functional, usable, and reliable web applications for our customers.


Posted: June 11th, 2009 by Neal Enssle
Tags: , , , ,
No Comments »

How to create Rails scaffolds and database tables dynamically

The idea I’m exploring here is whether or not we can build a CMS (content management system) in Ruby on Rails that can dynamically build a CMS. In other words, can we write Rails code that writes Rails code.

It seems we can. This is pretty awesome, and somewhat frightening, because it apparently works. Here’s a method in, say, a “utils_controller.rb”:

def generate_scaffold
    @results = `script/generate scaffold
    Things name:string value:string`
end

Note the use of backticks around the shell commands to generate a scaffold. If you run that method in your browser, it actually generates the controller, model, migration, etc.

Then do this:

def migrate
    @results = `rake db:migrate`
end

Yep. Now you just migrated the database and have new “things” table.

Eureka?

Obviously some issues here (like… OMGWTF! Run away! Do not try this at home!). But I’m a little bit excited…


Posted: October 10th, 2008 by Neal Enssle
Tags: , , ,
No Comments »

How to turn a string into CamelCase in Ruby

Here’s a function to turn any given string into a CamelCase “WikiWord” in Ruby:

def wikify(phrase)
  phrase.gsub!(/^[a-z]|\s+[a-z]/) { |a| a.upcase }
  phrase.gsub!(/\s/, '')
  return phrase
end

Voila. This turns “my dog has fleas” into “MyDogHasFleas”.

Note: I’m sure there’s a way to fix this so that it’s just one regular expression? Feel free to chime in!


Posted: July 21st, 2007 by Neal Enssle
Tags: , , ,
6 Comments »

How to dynamically update form elements in Rails using Ajax

Here’s the situation: You have two SELECT elements on a form. When the user chooses an item out of the first SELECT element, the contents of the second SELECT element need to change and show different values based on the initial selection.

This used to take quite a bit of JavaScript wizardry. But it’s pretty straightforward in Rails using a bit of Ajax. Here’s how:

First, make sure you’re including the Ajax libraries (Prototype, script.aculo.us, etc.) in your layout like so:

<html>
<head>
       <%= javascript_include_tag :defaults %>
</head>
<body>
...

Next, create a form with your initial SELECT, and empty second SELECT, and set up field observer. Here’s a really simple example:

<form>

<select id="states" name="states">
    <option value="0"></option>
    <option value="1">Colorado</option>
    <option value="2">Illinois</option>
    <option value="3">Wyoming</option>
</select>

<%= observe_field "states", :update => "cities",
:with => "city_id", :url => { :controller => "test",
:action => "get_cities" } %>

<br />

<select id="cities" name="cities">
    <option></option>
</select>

</form>

Finally, you’ll need to set up a method to handle the call from the observer and a corresponding view page to generate the HTML content that will replace everything betwen the SELECT tags in the second SELECT. Here’s an example "get_cities" controller:

def get_cities
    @cities = City.find_by_state(:all)
end

And an example "get_cities.rhtml" file:

<% for city in @cities %>
    <option value="<%= city.id %>"><%= city.name %></option>
<% end %>

And there you go. This much should dynamically update the "cities" SELECT element with new content every time the "onchange" event is fired on the initial "states" SELECT form element.


Posted: April 12th, 2007 by Neal Enssle
Tags: , , , ,
24 Comments »