~/talk

The Value of Docstrings

Talkat PyOhio 2019 · 2019-07-27..07-28· [documentation]
slides:none on file

Argues that consistent Python docstrings (follow PEP 257) produce clearer, maintainable code by declaring behavior, args, return values and side effects next to the code. Demonstrates with a concrete sort_ducks example, shows using builtins like help() and tools like doctest to embed runnable examples and Sphinx to generate external docs. Claims docstring-driven development tightens encapsulation, guides naming, makes tests self-documenting, and that doctest-confirmed examples reliably stay correct as code evolves.

AI-written summary · about

  1. 0:00Start
  2. 0:26About Me and Vanderbilt ACCRE
  3. 0:57But what about docstrings?
  4. 2:51Example Docstring
  5. 3:26Let's talk about comments
  6. 4:23Beginning to Code
  7. 5:11Basic Comments
  8. 5:35The play by play
  9. 6:32The metadata
  10. 7:16Inline change history
  11. 7:33Future plans
  12. 7:59Raw Emotion
  13. 8:14Other kinds of comments...
  14. 9:05Antithesis: To Comment
  15. 9:44Better Cleaner Code
  16. 10:40Naming is hard
  17. 11:04What property are we sorting on???
  18. 11:29Sorting Lotsa Ducks
  19. 11:54Are we sorting the list in place???
  20. 12:19Type hinting helps
  21. 12:51The halting problem
  22. 13:45Continuing to Code
  23. 14:59Synthesis: To Docstring
  24. 15:22Clean-ish code for an unclean world
  25. 15:52Writing more-or-less decent names
  26. 16:47Getting Your Ducks in a row
  27. 17:26Naming Hard, docstringing Easy
  28. 18:44Thoughtful Encapsulation - Doctrings or Underscores
  29. 20:31Docstring Driven Development
  30. 21:07Cleaner Code == Simpler Docstrings
  31. 22:41Sphinx - Generate Docs from Docstrings
  32. 26:30Some Concluding Thoughts
~/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.