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

Learn to Program: The Fundamentals
University of Toronto via Coursera
Python Data Representations
Rice University via Coursera
Introduction To Haskell Programming
Chennai Mathematical Institute via Swayam
Python Functions, Files, and Dictionaries
University of Michigan via Coursera
Python Data Structures
University of Michigan via edX