Edmund Schweppe | 1 Jun 02:54 2005
Picon

Re: Extreme Programming Refactored book (Danger of XP in fact)

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)

Ron Jeffries | 1 Jun 03:21 2005

Re: Zen Refactoring

Hi Hammett,

Thanks for the cut at an example ... comments below.

Around Tuesday, May 31, 2005, 2:27:42 PM, hammett wrote:

> Of course, it's pretty confusing afterwards. No question about it. But again
> I think the easier approach - given the circunstances - is to focus on the
> problem at hand, then later focus on refactoring the code. Doing both may
> have terrible results as someone here confirmed.

> But allow me to express myself.

> Given a non trivial problem at hand where you don't have a clear cut
> solution up front, but let's get concrete. The last time it happened (last
> sunday) I had to

> - Visit AST nodes using breadth-first
> - Upon MultipleVariableDeclarationStatement node
>   - Convert it to one or more SingleDeclarationStatement
>   - Check whether the identifier on the SingleDeclarationStatement was
> already on the current naming scope
>   - Check whether the identifier related to a local, instance of static
> field
>     - if instance or static, move the
> SingleDeclarationStatement to the 
> parent AST node
>     - replace the SingleDeclarationStatement node by an AssignmentExpression

> Well, I have never ever coded something similar, so I started from the
(Continue reading)

Jeff Grigg | 1 Jun 04:59 2005
Picon

Duplication vs Intention Revealing code (was: Zen Refactoring)

---  Tony Byrne wrote:
> As a TDD kata, I recently implemented a small program to
> convert integers to a string representation in words.
> (e.g. 1 --> one, 55 --> fifty-five). For me, this problem
> contains one example of duplication which was easy to
> make disappear once the duplicated code was made similar,
> and one where no matter how I look at it, I can't make
> the code similar enough to make the duplication disappear.
> [...]

This seemed like an interesting diversion, so I gave it a shot this 
evening:

Doing Test Driven Development, I write one test at a time (and then 
a few at a time), and end up with this for the final test class:

import junit.framework.TestCase;

public class NumbersAsWordsTest extends TestCase {
	public void testPositiveIntegerValues() {
		assertEqualsAsWords("zero",  0);
		assertEqualsAsWords("one",   1);
		assertEqualsAsWords("two",   2);
		assertEqualsAsWords("three", 3);
		assertEqualsAsWords("four",  4);
		assertEqualsAsWords("five",  5);
		assertEqualsAsWords("six",   6);
		assertEqualsAsWords("seven", 7);
		assertEqualsAsWords("eight", 8);
		assertEqualsAsWords("nine",  9);
(Continue reading)

yahoogroups | 1 Jun 07:30 2005

Re: Duplication vs Intention Revealing code (was: Zen Refactoring)

From: "Jeff Grigg" <jeffgrigg.at.charter.net <at> yahoogroups.at.jhrothjr.com>
To: "extremeprogramming <at> yahoogroups.com" 
<extremeprogramming.at.yahoogroups.com <at> yahoogroups.at.jhrothjr.com>
Sent: Tuesday, May 31, 2005 8:59 PM
Subject: [XP] Duplication vs Intention Revealing code (was: Zen Refactoring)

> ---  Tony Byrne wrote:
>> As a TDD kata, I recently implemented a small program to
>> convert integers to a string representation in words.
>> (e.g. 1 --> one, 55 --> fifty-five). For me, this problem
>> contains one example of duplication which was easy to
>> make disappear once the duplicated code was made similar,
>> and one where no matter how I look at it, I can't make
>> the code similar enough to make the duplication disappear.
>> [...]
>
> This seemed like an interesting diversion, so I gave it a shot this
> evening:

---

I wind up with a very different result, I suspect because I started
with ones and then stopped to think. This is, of course, in
Python.

The tests are a bit obvious, so I'm going to skip them. The
first interesting result comes after tests for 0 to 9:

class ConvertNumbersToEnglish:
    def numberToEnglish(self, number):
(Continue reading)

Ben Hogan | 1 Jun 09:51 2005
Picon

ANN: Sydney Australia: The XP Game <at> SyXPAC

Hi all,

If you are in Sydney Australia, join us at Sydney's XP Activities Club
for a presentation of the XP Game.

When?
Monday 6th June 2005, starting at 6:30pm.

Where?
James Squires, King's St Wharf, Sydney.

How to get there?
* http://groups.yahoo.com/group/SyXPAC/message/1448

More detailed info is available from our yahoo group:
* http://groups.yahoo.com/group/SyXPAC/message/1461

Join SyXPAC! See our wiki for more info:
* http://syxpac.org/ 

What is this XP Game thing?
* http://www.xp.be/xpgame.html 

regards,

Ben Hogan
Sydney's XP Activities Club
http://syxpac.org/

To Post a message, send it to:   extremeprogramming <at> eGroups.com
(Continue reading)

Tony Byrne | 1 Jun 10:15 2005

Re: Duplication vs Intention Revealing code (was: Zen Refactoring)

Hello Jeff,

Wednesday, June 1, 2005, 3:59:14 AM, you wrote:

JG> This seemed like an interesting diversion, so I gave it a shot this
JG> evening:

Oh my deity, what have I started? :-)

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.
(Continue reading)

Tony Byrne | 1 Jun 11:26 2005

Re: Duplication vs Intention Revealing code (was: Zen Refactoring)

Hello Jeff,

Okay, here's my Perl solution to the problem.  I've tweaked the layout
in the hope that it'll be more email friendly.  You'll see the
duplication that I was talking about in the modular arithmetic.  I've
left out the tests, since they are pretty obvious.  Comments on missed
opportunities etc., are most welcome.

====================== CUT ==========================

my %integerLookup =
(

        0 => 'zero', 1 => 'one', 2 => 'two', 3 => 'three',
        4 => 'four', 5 => 'five',6 => 'six', 7 => 'seven',
        8 => 'eight',9 => 'nine',

        10 => 'ten', 11 => 'eleven', 12 => 'twelve',
        13 => 'thirteen', 14 => 'fourteen', 15 => 'fifteen',
        16 => 'sixteen', 17 => 'seventeen', 18 => 'eighteen',
        19 => 'nineteen',

        20 => 'twenty', 30 => 'thirty', 40 => 'forty', 50 => 'fifty',
        60 => 'sixty', 70 => 'seventy', 80 => 'eighty',
        90 => 'ninety'
);

my %orderLookup = 
(
        100 => 'hundred',
(Continue reading)

Anthony Williams | 1 Jun 11:53 2005
X-Face
Picon

Re: Duplication vs Intention Revealing code

Tony Byrne <yahoogroups <at> byrnehq.com> writes:

> Hello Jeff,
>
> Wednesday, June 1, 2005, 3:59:14 AM, you wrote:
> 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.
>
> Now that's a new insight for me!  It never occurred to me to
> programmatically handle the appending of 'teen' or 'ty'.  Mind you
> won't 'Fivety' be wrong?

Is it only me and my spell checker that spells 40 "forty"?

I'll have a go at the exercise later, and post my code.

Anthony
--

-- 
Anthony Williams
Software Developer

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:
(Continue reading)

Karl Scotland | 1 Jun 12:53 2005
Picon

XP2005 Activity: The Music of Agile Software Development

Call for Participation

The Music of Agile Software Development
Karl Scotland
David Putman

Value Proposition
=================
A significant number of members of the Agile community seem to have a
musical background, leading to a hypothesis that there are commonalities
between the two disciplines, both of which draw on diversely skilled
individuals, collaborating to create a common vision. While this notion
is purely anecdotal and subjective, it is interesting enough to explore
further, and this activity session is intended to delve into those
commonalities in more detail.
The aim is to allow participants to:
 * have fun,
 * making music,
 * exploring new ideas, and
 * providing new insights into Agile software development
While musical skills, background, or interest would be beneficial, they
are by no means required.

Format Description
==================
The following items are planned:
 * Clapping Music - rehearsal and performance of an existing
composition, using nothing but hand claps.
 * Improvisation - creation of new compositions to a theme, using simple
toy instruments.
(Continue reading)

Jeff Grigg | 1 Jun 15:02 2005
Picon

Re: Duplication vs Intention Revealing code (was: Zen Refactoring)

--- Tony Byrne <yahoogroups <at> b...> wrote:
> Oh my deity, what have I started? :-)

My *EVIL Twin* did it.  ;->

> 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.
> 
> Now that's a new insight for me!  It never occurred to me to
> programmatically handle the appending of 'teen' or 'ty'.  Mind you
> won't 'Fivety' be wrong?

Actually, I just realized this morning that "fourty" is wrong; I 
need to learn to spell.  :-O  But it handles fifty and all the 
others correctly.

The pattern is pretty strong for 6 through 9:  six, six-teen, six-
ty, ...  But there are plenty of exceptions, which is why I end up 
with this code, to deal with the exceptions (after my spelling 
correction, this morning  ;-)

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
(Continue reading)


Gmane