Tuesday, March 22, 2016

The coordination tax of working alone

If you have team members working together on a project but separately on their own piece of the project then you need to coordinate that work.

There are lots of interestingly different ideas on how much 'cost' there is to this coordination. Ranging from it's a very low overhead, to it requires a full time manager who is the highest paid person on the team. Often these drastically different opinions are held on the same teams by the same people.

What I want to explore today however is what does the actual coordination looks like and what it would mean to get it right.

To start off with, there are a few types of coordination:

Multi-functional coordination

If someone is building the database and someone is building the UI those things need to talk to each other; usually through a middleware build by a third person. If they don't line up the costs are large indeed, ranging from "we need to redo this" to the far worse "Let's ship the wrong thing". 

The coordination includes:
  • knowing what each piece looks like
  • which functionality goes where
  • how to connect them
If you know the answers to all of this, then I believe you can make a fairly good assembly line fashion process. 

However, I would like to state categorically 
"If you have not yet built it, you don't know everything involved"

or as the great Woody Zuill said

"It's in the doing of the work that we discover the work that needs to be done"

And I don't mean done 'something like it'. If you've ever done a remodel on your house you will notice the estimates don't match the end result. It's not that this is the first remodel the contractor has ever done. Each situation has it own unique unknown unknowns.

Unfortunately, in software we are always doing something new because duplication is a copy and paste away.

Coordination of these types of tasks is expensive. You need an level of detail and level of oversight that is time consuming to obtain. If you don't get it right there is a lot of waste in the process that is silent.

Multi-person coordination

Even if you have people with the exact same skill set you will often have them working separately in an effort to maximize throughput. Here the coordination is in reducing duplication and keeping the code united. You don't want different people creating the same things or worst the same things in a different way where it's hard to realize they are even the same things. Ideally you want everyone producing unique work in the best possible way.

Perfect coordination 

I think perfect coordination is easiest to picture in a single entity. This entity is aware of the details and the larger picture. It has the skill sets for all aspects of the code. It incorporates new knowledge and processes  the moment it learns them. It has a memory of the previous work and knows when it should reuse pieces. It has high self awareness and doesn't have to spend a lot of time in meeting talking about work.

For many small projects this entity has been a single person.

I hypothesise that it is also the reason a Mob can be effective.


Sunday, March 6, 2016

Two people working on the same thing

One of the most common objections to Pair or Mob Programming is

"How can more than one people working on the same thing be productive?"

Let's put pairing that aside for a second though and look at common scenario:

Duplication in the average code base

You have a fairly big system, maybe 300,000 lines of code. How much of that is some form of duplication? Keep in mind that duplication is more than just copy and paste. It's anytime you need to change something in more than 1 place. This inconsistency is particularly insidious because it means new creative solutions for each one, plus a harder time identifying the problems later.

Note: I have seen cases of over 1500 instances of duplication in a single code base of this size. (If this seems familiar, hire me :-)

This duplication is one of the main causes of technical debt.

Obviously, you should remove this. You can see some techniques to do just that in our Practical Refactoring video but let's instead focus on the reason this duplication get created in the first place.

Keep in mind that often this duplication isn't written by the same single person. Often in is many people, over many months. Often they aren't even aware there is simular code somewhere else in the system. Who has time to just read over 300 thousand lines of code? [this is roughly 15 copies of the last Harry Potter Book] 

I doubt anyone would actively say "Please have a couple people write the same thing over 4-5 places in different ways". But, of course, no one is saying that. These areas of duplication are smaller than the tasks that are ever discussed. It's just something that happens but is unaccounted for. So let's account for it:

Time to do the Math

We need an amount of duplication which is a bit of a problem as there isn't a nice industry number for this. So I'll use a range from 5%-50% for the common scenario of 300,000 Lines of Code (LOC). 


300,000 * 0.05 = 15,000 LOC. 
15,000 LOC / (100 LOC/Day) = 150 days to create.


300,000 * 0.50 = 150,00 LOC.
150,000 LOC / (100 LOC/Day) = 1500 days / (300 day/year) = 5 years to create.

Meaning the average project has inadvertently budgeted between 1/2 man year to 5 man years to have 2 people work on the same thing for the purpose of making the code worse.

For which I have to ask:

"How can more than one people working on the same thing to be productive?"

Thursday, March 3, 2016

Defining 'Technical'

TL;DR: Technical can mean advanced, lingo and/or labs.

I'll like to a moment to get technical about the concept of technical talks...

It is often discussed before, during and after a conference about the 'right' amount of 'technical' talks. This is a very hard subject and in some of my recent discussion I started to get a glimpse into why:

"Technical is a poorly defined umbrella term."

As I started to break down what it means to be a technical talk, I started to see 3 axis emerge on aspects of a talk that can be considered technical.

The aspects of Technical

1) Lingo vs. Clear Words

"When my WCF backed by a RDMS wasn’t rendering in WPF I opened MSDN and said WTF"
If you are a .net developer this statement makes perfect sense, but everyone can understand
"When my program wasn’t connecting to the database I had to read the documentation online"

Pros: Lingo conveys large info in small words.
Cons: It isolates many people and makes them feel stupid while making the speaker look smart.

2) Advanced vs. Beginner

How many prerequisite do you need to attend this session?

If you hear the statement
"Then just apply your basic differential equations..."
you better have taken a few years of math. Whereas

"With just your basic arithmetic you can..."
is probably accessible to most people.

To be clear, I'm not trying to put a value judgement on the topic. Advanced topics don't inherently hold more value than beginner topics, but they do have more barriers to entry.

Pros: There are many great and valuable things in the advanced space.
Cons: Understanding the prerequisite most people have is very difficult and error prone. These sessions also have a limited audience by their very nature.

3) Labs vs. Concepts

Is this where the rubber meets the road or a 10,000 foot overview?

Will the presenter just mention that
"It’s saved in a settings configuration" or are we going to the command line and opening emacs?

It's worth mentioning that there is a fairly solid middle ground between concepts and labs that I would refer to as examples/demos. Like a lab where you are watching rather than doing.

Pros: Labs get to the real knowledge that concepts simply gloss over. For example: I understand the concept of flying a plane, but you don't want me to be your pilot.
Cons: Labs cover a much smaller space in a much larger time scale than concepts do. They are also very specific to a particular context that might not transfer to your own.

In the end we have a complicated 3D space looking something like this:
This is a very complicated space and most talks lie somewhere in between. However, I have found the most value from examining the 8 outermost points.

The 8 Extremes of Technical

1) Clear Beginner Concepts

This the least technical presentation.
That's not to demean the presentation. These talks for valuable and deliver a lot of (albeit shallow) understanding to a large audience.
This is the most common type of talk at most conferences.

2) Clear Advanced Concepts (GOOD)

This is technical in that you need a fair amount of knowledge to get into the conversation.
I have seen a fair amount of these talks at strangeloop. They are the kind of conversation where you understand every word but your head is still hurting.
These can also be the topics that open your eyes and stick with you for ages.

3) Advanced Concepts with lot’s of lingo

These are error prone. Like the above they make your head hurt but there is a good chance you didn't understand every word and you are too embarrassed to ask for clarification.
While Academic conferences seem to have a bunch of these the truth is they are everywhere.

4) Beginner Concepts with lingo (BAD)

I can see no use for this. Lingo implies a prerequisite for understanding but beginner states none is needed.
Obviously there is some use of this from a dark place where the speaker wants to feel superior or confuse the listener, but I believe more of this happens by accident because of
'the curse of knowledge'. Namely, once you internalize the lingo you forget that it is even is lingo; It's meaning just seems so clear.

5) Beginner Labs with lot’s of lingo (BAD)

See above, except because you are in the details the confusion is even more damaging.

6) Advanced Labs with lot’s of lingo

Interestingly, this seems to be a fairly good place for lingo. While I would still suggest brief definitions when introducing the terms (to avoid having people too embarrassed to ask) the efficiency that is provided by lingo is very beneficial here, you have people that have been in the space a while to fulfill their prereqs and you are using specific technology that needs names and labels.

7) Clear Advanced Labs 

Even better.

8) Clear Beginner Labs (GOOD) 

Beginner and Introductory talks are fantastic. They are heavily attended and help bring up new people (Doubles every 5 years means 50% of industry is less than 5 years of experience). Making these labs clear welcomes newbies and gives them a good experiences and solid learning. Labs help to make the learning concrete. I personally really enjoy these type of presentations and give many of them myself (so I'm a bit biased).
They do a have a couple pitfalls though.

  • They require more effort on the student. This is particularly bad if they are held right after lunch or competing with an easier session.
  • Sometimes you can't see the forest for the trees. Students will feel that they are missing out on the big important stuff because they are struggling with the details.
  • Experts like to discount them. "that's too basic" or "We've all seen that before" is the most common thing I hear from experienced people.

So those are my thoughts into everything that usually gets wrapped up in the term 'technical'.
Hopefully this blog post rates as a Clear, Advanced and somewhere in between Concepts/Lab.
If not, let me know in the comments.