~/talk

You Don't Need That!

Talkat PyOhio 2018 · 2018-07-28..07-29· [software-architecture, developer-experience]
slides:none on file

Claim: many classic OO design patterns are unnecessary in Python because built-in features do the same job more simply. Shows a Java-like Singleton and then a Pythonic module-level instance that prevents multiple constructions. Replaces Dependency Injection with runtime overrides and unittest.mock.patch for tests. Reimplements Iterator + Visitor and then simplifies them with generators and the for loops construct. Demonstrations compile and the idiomatic alternatives work and read far clearer, so prefer language features like the module system over reimplementing external-language patterns.

AI-written summary · about

  1. 0:00Start
  2. 1:35Development teams are increasingly polyglot.
  3. 2:07Object-Oriented
  4. 2:17Python?
  5. 4:06Let's implement 5 design patterns in Python
  6. 4:33Ideas on how to port software to Python
  7. 7:081. Namespacing
  8. 7:292. Functionality you can pass around
  9. 8:03A better solution: Modules
  10. 9:41Provide dependencies to classes as constructor arguments
  11. 11:53Unit Testing.
  12. 12:24Mocks
  13. 14:00Python doesn't need dependency injection because you can override
  14. 14:33Lets you use iterate over custom collections
  15. 17:39Python doesn't need explicit iterators because Generators are easier
  16. 17:49Perform a common operation on a collection
  17. 18:02Acceptor Visitor
  18. 19:11Separating the structure from the operation
  19. 21:03What did we learn?
  20. 21:20Python provides language features that replace common patterns
  21. 21:37"Everything is a variable" replaces binding restrictions
  22. 22:04Write code like you're writing Python.
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.