blog-post-3-days-with-sandi-metz

http://red-badger.com/blog/2014/08/20/i-spent-3-days-with-sandi-metz-heres-what-i-learned/

blog-post-3-days-with-sandi-metz#duplication-is-better-than-the-wrong-abstraction1 2 3 "Duplication Is Better Than The Wrong Abstraction

The next thing we were told to do goes against all intuition.

Write shameless code, full of duplication just to make the tests green." blog-post-3-days-with-sandi-metz#duplication-is-better-than-the-wrong-abstraction1 2 3

blog-post-3-days-with-sandi-metz#write-bad-code-until-abstraction-becomes-obvious Encouraged to write bad code (but tested) until a good abstraction made itself obvious. blog-post-3-days-with-sandi-metz#write-bad-code-until-abstraction-becomes-obvious

blog-post-3-days-with-sandi-metz#working-in-such-small-increments-feels-unnatural1 "It still feels a bit unnatural for me to work in increments this small and I often tend to combine some of them but I have been making an effort to try it out." blog-post-3-days-with-sandi-metz#working-in-such-small-increments-feels-unnatural1

blog-post-3-days-with-sandi-metz#shameless-technique1 It's a lot like the one that Matt, the guy from Wooster, used, saying he'd adopted it from his friend at Pivotal.

The point of being shameless is that repeating yourself is better than prematurely choosing the wrong abstraction. When you head into a problem it might seem so simple that it doesn't warrant too much consideration, however, if you resist the pull to abstract, you might discover a more compelling refactoring pattern once you have enough insight into the problem. The tests facilitate this by passing and then continuing to pass after the refactorings.

The other interesting thing about the shameless technique is that if you have shameful code at the end of the exercise, you didn't add enough tests. blog-post-3-days-with-sandi-metz#shameless-technique1

blog-post-3-days-with-sandi-metz#baby-step-path1 2 3 4 Good red, green, refactor forces you to "stay on the baby steps path". This can't be overstated. When I first bumped into Martin Fowler's "refactoring" I couldn't believe how little he did at each step. (This also plays into fast testing, since you need to be able to run them all the time) blog-post-3-days-with-sandi-metz#baby-step-path1 2 3 4

blog-post-3-days-with-sandi-metz#same-file1 Compile: Get the new code you want to implement to compile within the same file – it shouldn't be called yet, this is in order to catch syntax errors" (when talking about Katrina Owen's talk talk-therapeutic-refactoring ) blog-post-3-days-with-sandi-metz#same-file1

Referring Pages

software-concepts-dry testing-concept-duplicate-until-abstraction-found testing-concept-stages-of-testing testing-concept-red-green-refactor testing-concept-refactoring-incrementalism testing-concept-same-file testing-concept-fast-tests

People

person-sandi-metz person-jack-hoy