PyCon UK 2025

Python for Humans - Designing Python Code Like a User Interface
2025-09-21 , Main stage

What if we wrote Python the way designers build user interfaces? This talk explores how UI/UX design principles—like layout, labeling, affordances, and visual hierarchy—can help you write Python that’s intuitive to read, easy to navigate, and built with real users in mind.


In a team setting, your Python code is more than instructions for machines—it’s an interface your teammates will interact with, maintain, and extend. This talk draws on UI/UX design principles to help you write Python that’s more discoverable, readable, and user-friendly.

Over time, I’ve found that some of the biggest time sinks in collaborative development come from code that’s hard to revisit—whether it was written by a teammate or by me. It’s frustrating (and sometimes embarrassing) to open an old file I wrote and struggle to remember what it was doing or why. This talk shares design-inspired practices that have helped me write Python that’s easier to return to, share, and scale across teams.

We’ll explore how concepts from interface design—like visual hierarchy, layout, progressive disclosure, and affordances—can guide how you name functions, structure files, and write signatures that act like intuitive forms. You’ll learn how readers scan code top-down like users scan a web page, and how to optimize your code’s structure so teammates can navigate through it just like a clean interface.

We’ll cover:
* Why top-level structure is like layout design—and how init.py, main, and grouping logic improve scannability
* Why naming is like labeling in UI—clear, specific names help with navigation, tool-assisted discovery, and LLM code generation
* How vertical spacing and indentation in Python can mimic visual grouping and signal intent
* How decorators and type hints act like collapsible sections and labeled form fields, abstracting noise and clarifying usage
* Why tools like black, ruff, and Pylance are like automated accessibility checkers, enforcing consistency and clarity at scale
* When to apply design restraint—because cleverness, like parallax scrolling in 2015, often ages poorly

This talk isn’t about following a style guide—it’s about adopting a mindset: treating your codebase like a user experience. You’ll leave with real, beginner-friendly strategies and a new lens for writing impactful Python that others can read, trust, and extend—just like good UI.

No design background needed—just curiosity, empathy, and the desire to write Python you won’t dread revisiting.


What level of experience do you expect from your audience for this session?:

Basic

Justin Lee is a software engineer at Notion, where he builds AI and data infrastructure. He’s worked across startups and larger companies designing scalable systems, and teaches infrastructure and system architecture through several Udacity nanodegree programs. He enjoys mentoring engineers, consulting for companies on system architecture, and exploring better ways to deploy and maintain Python in production.