Commits

Miki Tebeka committed b83db8a

api design

  • Participants
  • Parent commits 1c06f18

Comments (0)

Files changed (1)

+- library: no state (or very little) and no callbacks
+- guidelines
+    1. Mode state is precious
+    2. Don't design exclusively for convenience 
+    3. Avoid knobs on knobs
+    4. Composing > Inheriting
+
+[1]
+    - import changes global state (even if you don't use anything)
+        - mp, logging
+    - What happens when you call "init" the 2'nd time?
+    - What can happen before __main__ and after it?
+    - Push state outside (see quote)
+
+[2]
+    - flask/pylons request which appears global but is per request
+    - If it makes it harder to write tests - people will write less tests
+    - Convenience != Cleanliness 
+
+[3]
+    - knob: replaceable component (like DEBUG flag)
+    - It confuses people
+    - Remove or hide
+
+[4]
+    - The Yo-Yo Problem (class graph is too complex)
+    - Smells slide (Inheritance Considered Harmful)
+    - In composition the contract is more "formal"
+    - If you offser superclass, make most (all?) methods abstract
+