Ah the result of rubber ducking for many years! Great stuff man, love how I feel like I'm pairing with you.
@craftvscruft8060
3 жыл бұрын
Totally the feel I was looking for! Thanks
@felipealvarez1982
2 жыл бұрын
I hope you wrote your own unit tests, as you would have had to do if this were actually a real legacy code refactoring assignment. I think it could be even more valuable if you finish all of the refactoring first, then you show exactly HOW EASY it is to add the Conjured case. Then the code becomes maintainable and extensible!
@craftvscruft8060
2 жыл бұрын
Hi Felipe, I agree that's frequently a part of the process. My favorite resource on bootstrapping testability is "Working Effectively With Legacy Code" by Michael Feathers. While this video was focused more on demonstrating the disciplined refactoring steps, I have two other videos that show introducing the same snapshot/golden-file style of tests used: "Testing a donut" kzitem.info/news/bejne/pot7rJWpsJZmf20 "Refactoring a Lisp Interpreter" kzitem.info/news/bejne/wKiv24yqqHeTaZw
@victorhe6139
2 жыл бұрын
Awesome walkthrough!
@craftvscruft8060
2 жыл бұрын
Thanks, Victor!
@explode1507
3 жыл бұрын
35:34 update backstage pass quality, shouldn't it be then sell in < 11 quality increase 2 times faster, so +2 and +3 then sell in < 6?
@craftvscruft8060
3 жыл бұрын
Yes, since updateBackstagePassQuality() method can potentially increment (by 1) 2 or 3 times, I think this will result in the behavior you've described and the tests confirm it. So if I understand you correctly, this is if anything a readability issue. We could imagine determining the increment amount (1, 2 or 3) and then doing the update in a separate step, might be better.
@kugacz
2 жыл бұрын
Other refactor approach: kzitem.info/news/bejne/mZiQzmmChpOEoHo
@craftvscruft8060
2 жыл бұрын
Thanks Marek! Sandi has great techniques, I'm a fan.
Пікірлер: 11