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 apart 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).
The code base size was about 200k lines, of which 150k was PHP, 35k JavaScript and the remainder CSS, XML, Ruby, and something else. I’m counting only non-empty and non-comment lines of code, using cloc.pl
.
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 know their economics and financials. 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 in 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, the project 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 costs merely:
¢13 per line
This also means that programmers were writing approximately 270 lines per hour or over 2,000 per day. The Mythical Man-Month talks about 10 lines per day, which is 200 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 curius, I’m using this script to get the numbers from Git:
git log "--since=3 months" --pretty=tformat: --numstat \ | gawk '{ add += $1; subs += $2; } END { printf "added: %s removed: %s\n",add,subs,loc }' -
You can validate the numbers for the second project here on Github: jcabi/jcabi-github.
Conclusion
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:
- $12–103: crazyontap.com
- $15–40: betterembsw.blogspot.nl
- over $5: joelonsoftware.com
Reference: | How much do you pay per line of code? from our JCG partner Yegor Bugayenko at the About Programming blog. |