4 ms·
Except that a lot of patterns tend to be language specific. So while it does teach you patterns, sort of - the patterns here are unlikely to be of any use, sinc
by anthonyb 15y ago
Except that a lot of patterns tend to be language specific. So while it does teach you patterns, sort of - the patterns here are unlikely to be of any use, since they won't be usable if you're writing Python, and if you're writing Java or C++ you'll need to translate them anyway.
For instance, go and have a look at the example code for his command pattern: http://dpip.testingperspective.com/?p=22 http://dpip.testingperspective.com/?p=22 That's not idiomatic anything - in normal Python you'd probably expose a couple of methods on the Light (on/off) and construct a switch to call those. Two classes, duck typed and no need for Command abstract classes and all the extra boilerplate.