> most containing the same duplicated (but subtly changed) blocks
I had a similar experience with an offshore company. This was during the early-mid 2000s, at the height of the offshoring era when $10/hour programmers in India were aplenty and everyone felt their job was soon to be outsourced. Turns out, no joke, they were being paid per line of code.
Despite having to maintain the heap of crap, I was amazed at the brilliance of their maniacal dark-art ability to implement as little functionality with as many lines of code possible. It was like code golf in reverse.
function isTrue(v) {
var result;
result = v;
if (!isFalse(result == true)) {
return result;
} else {
return isFalse(result);
}
}
function isFalse(v) {
var result;
result = v;
if (!isTrue(result == true)) {
return isFalse(result); // Tail recursion so this is fine.
} else {
return result;
}
}
if (isTrue(myBool) == true) { // TODO: Could this be refactored to isTrue(isTrue(myBool))?
return true;
} else if (isTrue(isFalse(myBool))) {
return false;
} else if (isFalse(isTrue(myBool))) {
return false;
} else {
return isFalse(isFalse(myBool));
}
I had a similar experience with an offshore company. This was during the early-mid 2000s, at the height of the offshoring era when $10/hour programmers in India were aplenty and everyone felt their job was soon to be outsourced. Turns out, no joke, they were being paid per line of code.
Despite having to maintain the heap of crap, I was amazed at the brilliance of their maniacal dark-art ability to implement as little functionality with as many lines of code possible. It was like code golf in reverse.