That might work in an academic setting, but doesn’t work in a real-life business setting where you’re not going to tie up two programmers (or two teams, more likely) reimplementing the same stuff just to satisfy your curiosity.
Maybe that’s one reason to have colleges that hand out computer science degrees? ;)
And of course programming is diverse enough to encompass a wide variety of needs and skillsets. Say, programmer A is great at writing small self-contained useful libraries, programmer B has the ability to refactor a mess of spaghetti code into something that’s clear and coherent, programmer C writes weird chunks of code that look strange but consume noticeably less resources, programmer D is a wizard at databases, programmer E is clueless about databases but really groks Windows GUI APIs, etc. etc. How are you going to compare their productivity?
Very carefully.
In seriousness, the answer is that you wouldn’t compare them. Comparing programmer productivity across problem domains like you describe is rarely all that useful.
You really only care about comparing programmer productivity within a domain, as well as comparing the same programmers’ productivity across time.
Maybe that’s one reason to have colleges that hand out computer science degrees? ;)
Very carefully.
In seriousness, the answer is that you wouldn’t compare them. Comparing programmer productivity across problem domains like you describe is rarely all that useful.
You really only care about comparing programmer productivity within a domain, as well as comparing the same programmers’ productivity across time.