Approximity blog home
365 to 374 of 695 articles InfoSyndicate: full/short

Zen Refactoring   24 May 05
[print link all ]
Alex Chaffee posted this to the xp-list.
 Yesterday I was pairing with Patrick, our new intern. He's great,
 smart as a whip, and willing to learn. (When I told him we write tests
 first, he laughed, incredulously, but then I said No, really, I'm
 actually serious, and he listened, and later, he said, Oh, now I see.)
 At the end of a long successful refactoring (turning a clutch of
 static methods into instance methods), we were sort of buzzing and
 didn't want to stop, were casting about for other refactorings to do
 in the same class. I suggested a technique I only just then gave a
 name to, that I've done occasionally on my own for a long time, but
 hadn't yet taught: Zen Refactoring.

 "Just let your eyes unfocus and scroll through the code and look for
 refactorings. Look for duplication; look for too-long or
 too-deeply-indented code blocks. When you notice something odd, don't
 read it, just select it, hit Extract Method (ctl-alt-M), and hit
 random keys for the name. Then focus your eyes again and see what
 you've done."

 I demonstrated. The first time we hit a bunch of print statements with
 repeated formatting -- it worked, but the refactoring was tedious,
 with marginal payoff. But the second time was golden. I saw a blurry
 if-else block; the first arm meandered for 15 or 20 deeply-indented
 lines, the second for fewer; their logic appeared opaque and disjoint.
 But after extracting the first block as a method, lo and behold:

 if (something() || other()) {
  customerId = sdlfjds(x, y, z);
  } else {
    user = someOtherExistingMethod();
    customerId = user.getUserId();
 }

 IDEA had figured out that the result of that meander was a single
 value, and returned it from the new method. It was instantly clear
 that we should rename the extracted method
 customerIdForSomethingOrOther", and extract the whole conditional as
 "getCustomerId". Shift-F6, ctl-alt-M, high five.

 Then it was Patrick's turn. Not quite as much of a slam-dunk but still
 a worthy refactoring. I can't wait to get an incredulous laugh from
 the next one I spring this on...

AutrijusRaisingPerl6IntoARealPuppy   18 May 05
[print link all ]
Perl6 in Haskell after 100 days .. :-) Enjoy the link redhanded.hobix.com/inspect/autrijusRaisingPerl6IntoARealPuppy.html

When talking to CEO and CFO types ..   16 May 05
[print link all ]
Ron Jeffries posted in the xp-list:
 When I talk with CEO and CFO types, I generally emphasize that XP /
 Agile projects focus on the delivery of running, tested, actual
 software, along the lines of my article /A Metric Leading to
 Agility/, http://www.xprogramming.com/xpmag/jatRtsMetric.htm

Good article about Tiger   08 May 05
[print link all ]
My girlfriend told me to get a computer that makes less noise .. so I took the opportunity to buy a Mac-Mini and to have a nice computer to play with :-).

Thanks to Sven for emailing me this link .. a good overview article about Tiger. arstechnica.com/reviews/os/macosx-10.4.ars

Nice graphics   06 May 05
[print link all ]
Joao made this nice graphics and posted it in his blog

Link of the day   04 May 05
[print link all ]
links.userfriendly.org/lotd/http://www.delltechforce.com/

Die Larry Ellison Puppe k?mpft gegen "Big Iron" und sagt "Let’s go in and kick some proprietory ass!"

ROTFL

Sin City Comic-to-Screen Comoparison   24 Apr 05
[print link all ]
Very nice link about a cool movie.

Seeing Metaclasses Clearly   19 Apr 05
[print link all ]
why wrote a nice article.
 I've written a very nuts+bolts article on metaclasses (aka virtual
 classes or metaobjects), since they still lurk under a shroud of fear
 and enigma.

whytheluckystiff.net/articles/seeingMetaclassesClearly.html

 I'm hoping this will help uncover the truth.  If anything is unclear,
 please report it.  Shed a light.

Collaborative Corporate Culture   19 Apr 05
[print link all ]
home.att.net/~geoffrey.slinker/maverick/CCC.html

300 engineers take forever writing anything   19 Apr 05
[print link all ]
Nice post by Elizabeth D. Rather
 Heh, that reminds me of a time in the late 70's, when IBM came out with a
 new "mini-computer".  We put Forth on it for a customer.  Our standard
 system came with a database capability, multitasker, multi-user support,
 lots of other features.  Another customer was considering this machine, and
 we made a presentation on our software.  Some IBM engineers were also there.
 They said, "This machine has only been on the market for a few months.  We
 have 300 engineers writing software for it in Boca Raton (Florida), and they
 only have a macro assembler and simple executive running so far.  How could
 you have done all this with only one engineer?"

 Well, I said something about having a standard design implemented in high
 level that was easy to port, but of course the real answer is that 300
 engineers would take forever writing anything!

 

powered by RubLog
365 to 374 of 695 articles Syndicate: full/short