Quantcast
Channel: refactoring - avdi.codes
Browsing latest articles
Browse All 8 View Live

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 Article



Testing 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 Article

Image may be NSFW.
Clik here to view.

Refactoring 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 Article

Making 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 Article

Every 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 Article


Kata 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 Article

Faking 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 Article

Test-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

Browsing latest articles
Browse All 8 View Live


Latest Images