This is a mobile version of the article, full version is here.
11 April 2014
How Much Do You Pay Per Line of Code?
Yes, I know, "line of code" (LoC) is a very wrong metric. There are tons of articles written about it, as well as famous books. However, I want to compare two projects in which I have participated recently and discuss some very interesting numbers.
Project #1: Traditionally Co-located
The first project I was a part of was performed by a traditionally co-located group of programmers. There were about 20 of them (I'm not counting managers, analysts, product owners, SCRUM masters, etc.) The project was a web auctioning site with pretty high traffic numbers (over two million page views per day).
and the remainder CSS, XML, Ruby, and something else. I'm counting only
non-empty and non-comment lines of code, using
It was a commercial project, so I can't disclose its name.
The team was co-located in one office in Europe where everybody was working "from nine 'til five." We had meetings, lunches, desk-to-desk chats and lots of other informal communications. All tasks were tracked in JIRA.
Project #2: Extremely Distributed
The second project was an open source Java product, developed by an extremely distributed team of about 15 developers. We didn't have any chats or any other informal communications. We discussed everything in GitHub issues. The code base was significantly smaller with only about 30k lines, of which about 90% was Java and the rest in XML.
Maturity of Development
Both projects hosted their code bases on GitHub. Both teams were developing in feature branches- even for small fixes.
Both teams used build automation, continuous integration, pre-flight builds, static analysis and code reviews. This indicates the maturity of the project teams.
Both projects satisfied the requirements of their users. I'm mentioning this to emphasize that both projects produced valuable and useful lines of code. There was no garbage and almost no code duplication.
Show Me the Money
In both projects, my role was called that of lead architect, and I knew their financial details. Besides that, I had access to both Git repositories, so I can measure how many new lines (or changed lines) were introduced by both teams in, say, a three-month period.
Now, let's see the numbers.
The first project (the one that was co-located) was paying approximately €50,000 annually to a good developer, which was about $5,600 per month or $35 per hour. The second one (the extremely distributed project) was paying $20-35 per hour, for completed tasks only according to one of the principles of XDSD.
The first one, in three months, produced 59k new lines and removed 29k in
changes in the
master branch, which totals 88k lines of code. The project
resulted in about 10,000 man hours to produce these lines (20 programmers, three
months, 170 working hours per month)—which equates to about $350k. Therefore,
cost a whopping
$3.98 per line
The second project, in the same three month period, produced 45k new lines and removed 9k, which comes to 54k in all. To complete this work, we spent only $7k (approximately 350 working hours in 650 tasks). Thus, the project cost merely:
¢13 per line
This also means that programmers were writing approximately 150 lines per hour or over a thousand per day. The Mythical Man-Month talks about 10 lines per day, which is a hundred times less than we saw in our project.
$350k vs $7k, $3.98 vs ¢13? What do you think?
How to Validate the Numbers?
If you're curious, I'm using hoc to get the numbers from Git (it is explained in Hits-of-Code Instead of SLoC). You can validate the numbers for the second project here on GitHub: jcabi/jcabi-github.
What I'm trying to express with these numbers is that distributed programming is much more effective, money-wise, than a co-located team. Again, I can hear you saying that "line of code" is not a proper metric. But, come on, $0.13 vs. $3.98? Thirty times more expensive?
It's not about metrics any more. It's about preventing wasteful man hours and the huge waste of money that comes with them?
Can We Do the Same?
Of course, the same results can't be achieved by just telling your programmers to work from home and never come to the office. XDSD is not about that. XDSD is about strict quality principles, which should be followed by the entire team.
And when these principles are in place—you pay thirty times less.
By the way, this is what people say about their projects:
What are your numbers? Please post your comments below.