We often talk about with Xamarin that it lets us achieve such and such percentage of common code, but I am actually wondering how do we define what we mean by such a number. I want to be able to compute this in my continuous integration build and be able to track it over time.
I am using lines of code as the metric (maybe not the best, but that's what I'll start with). So if I define LOC(common), LOC(droid), and LOC(touch) the answer is how to compute the percent.
My initial version was LOC(common) / (LOC(common) + LOC(droid) + LOC(touch)) to give one number for the entire codebase. This gives a good number if you wanted to compare to something like HTML + Javascript cross platform tools.
But it struck me today that is an incorrect way to define it. If we added another platform into the mix that would go in the denominator and lower our percentage which seems misleading.
So it seems to me that in reality you have to compute it per platform as in for platform X you have LOC(common) / (LOC(common) + LOC(X)). This seems to be a better metric for charting progress of development.
Curious what others thoughts are on this. I saw a post from a year ago where someone was reporting their numbers and they basically reported both ways.