Overview
Syllabus
Intro
WARNING
Code Golfing
Snake Oil' Benefits
What are Strokes?
Ever written code like this?
Counting up the strokes
Visual Diff
Initializing dict values
Cleaning Up Resources
Context Managers
Exception Handling
"Simple" implementation
Let's decorate with @contextmanager
Functions aren't scary
Quick Functions Primer
Goofus and Gallant Highlights
Goofus and Gallant explore functions
Goofus and Gallant explore map
Goofus and Gallant explore reduce
Goofus and Gallant explore filters
Comprehending Comprehensions
Comprehensions Deconstructed
Better Mapping with Comprehensions
Better Filtering with Comprehensions
Better Reduces with Compressions
Better dicts with Comprehensions
Where can conciseness help?
Quick Whiteboarding Tip
Final Takeaways • Stroke reduction (making code more concise) reduces the cognitive load to understand code.
Taught by
EuroPython Conference