One day, I was watching another Uncle Bob’s video (yes, they are addictive), when I see one example he gave when talking about open closed principle, it ringed a bell in my head. This looked familiar! The type in some data classes, some switchs or ifs, some &&s and ||s all dancing around in the class. I can almost hear them teasing: “Come and catch me! Come and catch me!”.
Moomin ~
My wife ~
Ayumi Hamasaki, painted by Krita ~
In one of Uncle Bob’s video, he talked about this game called “Master Mind” when he was teaching Single Responsibility Principle(SRP). After googled the game, turns out that it is actually a quite famous board game. For more information about the game, please look here -> wiki. The game can be played by two people. One comes up with a code, the other one tries to guess. The one who comes up with the code has to score the guesser’s guess based on some rules.