YoVDO

Teeing up Python - Code Golf

Offered By: EuroPython Conference via YouTube

Tags

EuroPython Courses Python Courses Tuples Courses Functional Programming Courses

Course Description

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore the art of code golfing in Python through this 27-minute EuroPython Conference talk. Discover techniques to minimize code length while maintaining functionality and readability. Learn about default values, tuple manipulation, list comprehensions, functional programming concepts, and context managers. Gain insights into writing more Pythonic and concise code that enhances understanding for future readers. Apply these strategies to reduce cognitive load and improve code clarity in your own projects.

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

Related Courses

A Brief History of Data Storage
EuroPython Conference via YouTube
Breaking the Stereotype - Evolution & Persistence of Gender Bias in Tech
EuroPython Conference via YouTube
We Can Get More from Spatial, GIS, and Public Domain Datasets
EuroPython Conference via YouTube
Using NLP to Detect Knots in Protein Structures
EuroPython Conference via YouTube
The Challenges of Doing Infra-As-Code Without "The Cloud"
EuroPython Conference via YouTube