1 Jun 2005 02:54
Re: Extreme Programming Refactored book (Danger of XP in fact)
Edmund Schweppe <schweppe <at> ieee.org>
2005-06-01 00:54:47 GMT
2005-06-01 00:54:47 GMT
Ron Jeffries wrote:
> On Monday, May 30, 2005, at 8:19:01 PM, Edmund Schweppe wrote:
>> My extraordinarily limited understanding of both Ron and XP leads
>> me to believe that Ron might even go so far as to disavow the very
>> existence of an "XP spokesperson."
> I would not so disavow.
Thus proving by demonstration the limited nature of my understanding.
(Not that it was ever in question, mind you.)
>> However, my not-Ron-ness is the stuff of legends, and thus my
>> aforementioned belief should be taken with a particularly large
>> grain of metaphorical salt.
> Yum. Love metaphorical salt. Got any semantic popcorn? :)
Semantic popcorn? Is that kosher?
To Post a message, send it to: extremeprogramming <at> eGroups.com
To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe <at> eGroups.com
ad-free courtesy of objectmentor.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/extremeprogramming/
<*> To unsubscribe from this group, send an email to:
extremeprogramming-unsubscribe <at> yahoogroups.com
(Continue reading)
JG> Doing Test Driven Development, I write one test at a time (and then
JG> a few at a time), and end up with this for the final test class:
[snipped tests]
Your tests look very similar to mine. We both eliminated the obvious
duplication [extract method] in the tests to make each test case a
one-liner.
JG> And I a nice simple implementation for two byte positive integers:
final int tensDigit = value / 10;
final int onesDigit = value % 10;
I see that already our approaches are slightly different, but the
above fragment is similar to my own code and it's this bit the becomes
duplicated in an awkward way in my own solution.
JG> I can go on to bigger numbers, but I see duplication here:
JG> - The two "base 10" numbers, used to separate "tens" from "ones".
JG> - That "four" and "four-teen" and "four-ty" is duplication.

final String[] digitPrefixes = new String[]
{"twen~", "thir~", "for~", "fif~"};
if (digit == 4 && teens || digit > 5) {
return asWords(digit);
} else {
final String prefix = digitPrefixes[digit - 2];
final String prefixSansTilde = prefix.substring(0, prefix.length
RSS Feed