Hi all,
I've added a page (Extreme Programming) to my web site (www.tedbracht.co.uk) taking the reader through some of the principles of XP. Of course it is using the D5Pro XP tools, but if you haven't got that (yet) you could do the testing part with D4 and SUnit. You will miss out on the refactoring tools though and have to do that the long way round. Enjoy. Ted www.tedbracht.co.uk |
"Ted Bracht" <[hidden email]> writes:
> Hi all, > > I've added a page (Extreme Programming) to my web site > (www.tedbracht.co.uk) > > taking the reader through some of the principles of XP. Of course it > is > > using the D5Pro XP tools, but if you haven't got that (yet) you could > do the > > testing part with D4 and SUnit. You will miss out on the refactoring > tools > > though and have to do that the long way round. > > Enjoy. Cool, I suggested a long time ago that Ron Jeffries should do a book on hands on Extreme Programming with Dolphin Smalltalk, the time seems to be ripe, with the release of Dolphin XP. Nudge, nudge :-) -- Vennlig hilsen Syver Enstad |
On Thu, 02 May 2002 15:21:19 GMT, Syver Enstad <[hidden email]>
wrote: >Cool, I suggested a long time ago that Ron Jeffries should do a book >on hands on Extreme Programming with Dolphin Smalltalk, the time seems >to be ripe, with the release of Dolphin XP. Nudge, nudge :-) It'd be fun. But how many would be sold? Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com I'm giving the best advice I have. You get to decide whether it's true for you. |
In reply to this post by Ted Bracht-2
On Thu, 2 May 2002 11:22:19 +0100, "Ted Bracht" <[hidden email]> wrote:
>Hi all, > >I've added a page (Extreme Programming) to my web site (www.tedbracht.co.uk) >taking the reader through some of the principles of XP. Of course it is >using the D5Pro XP tools, but if you haven't got that (yet) you could do the >testing part with D4 and SUnit. You will miss out on the refactoring tools >though and have to do that the long way round. Good stuff. Thanks for taking the initiative. I'll dare to comment, with respect, since you had the energy to actually DO this! I hope you don't mind ... I've just started to look. An early comment: I wouldn't want to have all those comments in the test: DriverTest>>testName "both firstname and surname are nil, return an empty string" self assert: driver name = ''. "firstname is nil, return surname without space" driver surname: 'Barrichello'. self assert: driver name = 'Barrichello'. "firstname and surname are set, return both with space in between" driver firstname: 'Rubens'. self assert: driver name = 'Rubens Barrichello'. "surname is blank, return firstname without space" driver surname: ''. self deny: driver name = 'Rubens '. XPers believe that the need for a comment is a signal that the code needs to be more clear. At first glance I might do something like: testUninitializedDriverHasBlankName self assert: driver name = '' testSurname driver surname: 'Barrichello'. self assert: driver name = 'Barrichello' testFirstAndSurname driver surname: 'Barrichello'. driver firstName: 'Rubens'. self assert: driver name = 'Rubens Barrichello' and so on. In the last test, I might do this if I wanted to emphasize the missing space: testFirstNameOnly driver firstName = 'Rubens'. self assert: driver name = 'Rubens'. Note that my tests are all running on a fresh instance so I didn't need to clear the surname for that last one. self deny: driver name last = Character space Also, as a matter of style I usually wouldn't create an object and then jam its instance variables. Instead I'd have a constructor method: Driver class>firstname: firstNameString surname: surnameString The classic XP Smalltalk style is to follow Kent Beck's Best Practice Smalltalk Patterns, from which the above is taken. More when I know more ... Regards, Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com I'm giving the best advice I have. You get to decide whether it's true for you. |
In reply to this post by Ted Bracht-2
On Thu, 2 May 2002 11:22:19 +0100, "Ted Bracht" <[hidden email]> wrote:
>I've added a page (Extreme Programming) to my web site (www.tedbracht.co.uk) >taking the reader through some of the principles of XP. One more thing ... I'd suggest doing the tests one at a time. See if you like it better that way. One assert, a little code, another assert, lather, rinse, repeat. I find that ludicrously small steps help me go faster and let me walk away from the computer any time. Since Smalltalk just /loves/ tiny steps, the technique works particularly well there. Just an idea ... Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com I'm giving the best advice I have. You get to decide whether it's true for you. |
In reply to this post by Ron Jeffries-2
Hi Ron,
Some excellent suggestions - I've only just started so am still learning myself. I'll collate all feedback and do a rewrite shortly. So if anybody else has suggestions, additions and so on, please let me know. Ted "Ron Jeffries" <[hidden email]> wrote in message news:[hidden email]... > On Thu, 2 May 2002 11:22:19 +0100, "Ted Bracht" <[hidden email]> wrote: > > >Hi all, > > > >I've added a page (Extreme Programming) to my web site (www.tedbracht.co.uk) > >taking the reader through some of the principles of XP. Of course it is > >using the D5Pro XP tools, but if you haven't got that (yet) you could do the > >testing part with D4 and SUnit. You will miss out on the refactoring tools > >though and have to do that the long way round. > > Good stuff. Thanks for taking the initiative. I'll dare to comment, with > respect, since you had the energy to actually DO this! I hope you don't mind ... > > I've just started to look. An early comment: I wouldn't want to have all those > comments in the test: > > DriverTest>>testName > "both firstname and surname are nil, return an empty string" > self assert: driver name = ''. > "firstname is nil, return surname without space" > driver surname: 'Barrichello'. > self assert: driver name = 'Barrichello'. > "firstname and surname are set, return both with space in between" > driver firstname: 'Rubens'. > self assert: driver name = 'Rubens Barrichello'. > "surname is blank, return firstname without space" > driver surname: ''. > self deny: driver name = 'Rubens '. > > XPers believe that the need for a comment is a signal that the code needs > more clear. At first glance I might do something like: > > testUninitializedDriverHasBlankName > self assert: driver name = '' > > testSurname > driver surname: 'Barrichello'. > self assert: driver name = 'Barrichello' > > testFirstAndSurname > driver surname: 'Barrichello'. > driver firstName: 'Rubens'. > self assert: driver name = 'Rubens Barrichello' > > and so on. In the last test, I might do this if I wanted to emphasize the > missing space: > > testFirstNameOnly > driver firstName = 'Rubens'. > self assert: driver name = 'Rubens'. > > Note that my tests are all running on a fresh instance so I didn't need to > the surname for that last one. > self deny: driver name last = Character space > > > Also, as a matter of style I usually wouldn't create an object and then jam its > instance variables. Instead I'd have a constructor method: > > Driver class>firstname: firstNameString surname: surnameString > > The classic XP Smalltalk style is to follow Kent Beck's Best Practice Smalltalk > Patterns, from which the above is taken. > > More when I know more ... > > Regards, > > Ronald E Jeffries > http://www.XProgramming.com > http://www.objectmentor.com > I'm giving the best advice I have. You get to decide whether it's true for |
In reply to this post by Ted Bracht-2
Hi Ted
I quickly checked out your page, and think it's quite good as an intro to XP. Ron hit most of the important points in his eloquent post, and I don't really want to nit-pick on the rest. There's one method that could be more elegantly refactored, though: String>>capitalizeEachWord "Change the first letter of each word to uppercase" | in out capitalizeNext | in := ReadStream on: self. out := WriteStream on: (String new: self size). capitalizeNext := true. [in atEnd] whileFalse: [ | char | char := in next. out nextPut: (capitalizeNext ifTrue: [char asUppercase] ifFalse: [char]). capitalizeNext := char isLetter not]. ^out contents SmallLint (in other dialects) would flag your posted version as being "optimizable". Cheers Joseph Ted Bracht wrote: > Hi all, > > I've added a page (Extreme Programming) to my web site (www.tedbracht.co.uk) > taking the reader through some of the principles of XP. Of course it is > using the D5Pro XP tools, but if you haven't got that (yet) you could do the > testing part with D4 and SUnit. You will miss out on the refactoring tools > though and have to do that the long way round. > > Enjoy. > > Ted > www.tedbracht.co.uk -- Joseph Pelrine [ | ] MetaProg GmbH Email: [hidden email] Web: http://www.metaprog.com "Inheritance was invented at 2 AM between January 5th and 6th, 1967" - Krysten Nygaard |
In reply to this post by Ron Jeffries-2
Ron Jeffries <[hidden email]> writes:
> >Cool, I suggested a long time ago that Ron Jeffries should do a book > >on hands on Extreme Programming with Dolphin Smalltalk, the time > seems to be ripe, with the release of Dolphin XP. Nudge, nudge :-) > > It'd be fun. But how many would be sold? At least one! I had been trying out some of the XP practices when I read Ron's article where he refactored a hastily built alarm clock into prose like (Dolphin) smalltalk code, it was first then I *got* the feel of programming and testing at the same time. A book of extreme programming episodes like the alarm clock (or maybe different) would be a very cool thing in my eyes. -- Vennlig hilsen Syver Enstad |
In reply to this post by Syver Enstad-3
Do you have a link for the article you referenced?
jlo Syver Enstad wrote: > Ron Jeffries <[hidden email]> writes: > > > >>>Cool, I suggested a long time ago that Ron Jeffries should do a book >>>on hands on Extreme Programming with Dolphin Smalltalk, the time >> >>seems to be ripe, with the release of Dolphin XP. Nudge, nudge :-) >> >>It'd be fun. But how many would be sold? > > > At least one! > > I had been trying out some of the XP practices when I read Ron's > article where he refactored a hastily built alarm clock into prose > like (Dolphin) smalltalk code, it was first then I *got* the feel of > programming and testing at the same time. A book of extreme > programming episodes like the alarm clock (or maybe different) would > be a very cool thing in my eyes. |
Jeffrey Odell <[hidden email]> writes:
> Do you have a link for the article you referenced? > > jlo > > Syver Enstad wrote: > > Ron Jeffries <[hidden email]> writes: > > > >>>Cool, I suggested a long time ago that Ron Jeffries should do a > book > > >>>on hands on Extreme Programming with Dolphin Smalltalk, the time > >> > >>seems to be ripe, with the release of Dolphin XP. Nudge, nudge :-) > >> > >>It'd be fun. But how many would be sold? > > At least one! > > I had been trying out some of the XP practices when I read Ron's > > article where he refactored a hastily built alarm clock into prose > > like (Dolphin) smalltalk code, it was first then I *got* the feel of > > > programming and testing at the same time. A book of extreme > > programming episodes like the alarm clock (or maybe different) would > > > be a very cool thing in my eyes. I think it's on Ron Jeffries site, www.xprogramming.com.... Yes, there it was: http://www.xprogramming.com/xpmag/alarm_clock.htm -- Vennlig hilsen Syver Enstad |
Free forum by Nabble | Edit this page |