When to use classes(...and when not!)
Use a class:
when multiple copies of state needed
e.g.: client connections; drawing objects
Use a module:
when on copy of state always suffices
e.g.: logger; cache
Use functions:
when no state needed; e.g. sin()
Previous slide
Next slide
Back to first slide
View graphic version