Doctor, it hurts when you say that
bq. In your response, for instance, you say “I prefer thinking before writing code.” Well, so do I, but the fact of the matter is some people don’t and some people make mistakes based on inexperience...
View ArticleTesting Private Methods
Periodically the question of how to test private methods comes up at work or online. My answer is: don’t. It may seem trite, but there is some reasoning behind it. Private methods are, by definition,...
View ArticleRefactoring in Ruby
I’ve started working my way through Refactoring in Ruby, by William C. Wake and Kevin Rutherford. I haven’t been this excited about a book since Michael Feathers’ Working Effectively with Legacy Code....
View ArticleMaking Little Classes out of Big Ones (video)
I recently visited the Hashrocket offices in Jacksonville, and while I was there I did a Lunch & Learn talk on the topic of of breaking down too-big classes into smaller pieces. In it I went over...
View ArticleEvery day, in every way
In a Thoughtbot article, Joe Ferris asks “how much should I refactor?“. The original XP practices have an answer of sorts: “mercilessly“. Quoting Ron Jeffries: One of the ExtremeProgramming practices...
View ArticleKata and Analysis by Jim Weirich
Towards the end of this video there’s a terrific discussion of the point at which DRYing out the code any further would just make it harder to understand. I was also amused by the quote: I have...
View ArticleFaking Method Inputs with OpenStruct feat. Kerri Miller
During my RubyTapas script review with upcoming guest chef Kerri Miller, we spent some time refactoring a method toward lower complexity. In the process we needed to isolate it from its dependencies,...
View ArticleTest-Driven Re-implementation with Josh Thompson
Yesterday Josh Thompson, one of my Rubber Duck Session clients, proposed a novel idea for deliberately practicing coding skills: take a popular open-source project with a good test suite, delete a...
View Article