Refactoring a multi-argument method into chained single-argument methods

Published: 07 December 2016
on channel: Paul Gestwicki
438
14

Clean Code asks us to write methods that only have zero or one parameter. In this video, I refactor a method with two parameters into single-argument methods using method chaining.

I installed IDEA 2016.3 just before this video, and I had to turn off their new "parameter hints" feature in order to drive the point home here. Note that this feature illustrates the problem that Robert Martin brings up in Clean Code, in a way that hearkens back to named parameters a la Smalltalk. Anyway, time will tell if this feature becomes an IDE standard or not. In the meantime, this technique will still serve you.


Watch video Refactoring a multi-argument method into chained single-argument methods online without registration, duration hours minute second in high quality. This video was added by user Paul Gestwicki 07 December 2016, don't forget to share it with your friends and acquaintances, it has been viewed on our site 438 once and liked it 14 people.