This is a remote pair programming codecast with Wassel Alazhar on an interesting problem called Good Friends.
After implementing a bit of the problem, we discuss about what we have done. We observe a lot of duplication and we debrief.
We started understanding that we might need some personas for the friends to understand better the business.
Check the video and please come with your ideas and comments
- We look at duplication and when we have the same parameters of functions is natural we extract the functions to be together. Some of these parameters are encapsulated, some are not. So it’s more about similarity being transformed into clear duplication.
- We look at naming, we have functions that have the same noun, like debt, and we should extract them together.
- We use small visual distance: when we extract things, we keep the duplicated items close to each other to understand the level of similarity between them.
- With TDD as if you meant it and using Python, we observe that the first parameter of functions is duplicated and it can easily change into the self parameter, thus generalizing the logic.
- At times we look at how to transform similarities into clear duplication. We have some parameters that aren’t duplicated, but they are at different levels of abstraction / encapsulation and that is why the duplication is hidden.
- As a conclusion on how to spot similarities (or duplication): we start by having small visual distance, we look through the parameters and their names, and the concepts that are hidden behind the names.
Many thanks to Wassel for taking the time to record this codecast with me.
Watch other episodes of remote pair programming: https://www.youtube.com/playlist?list=PLlOmk325wSKLFF3pXOLVjzZHhQhs_2Ds8
Watch Legacy Coderetreat: https://www.youtube.com/playlist?list=PLlOmk325wSKLytvYhnGLR0v3PhWNdGMon
Watch Evolutionary Design: https://www.youtube.com/playlist?list=PLlOmk325wSKLjw_RGzpBV8MIfi4zSlbwM