Transforming Code into Beautiful, Idiomatic Python
Channel:Next Day Video · Length:48:51 · Published:2013-03-21 · Views:1094212
Summary
Raymond Hettinger's PyCon 2013 talk on transforming code into idiomatic Python through a series of before-and-after refactorings. It shows how to use iterators, dictionaries, named tuples and other language features well.
Why HN recommends it
HN treats it as a must-watch classic for writing Pythonic code, though somewhat dated for modern Python.
the excellent talk "Transforming Code into Beautiful, Idiomatic Python". — HN, 2021
Python, Ruby & scripting languages · Software practice, open source & careers
Subtitles (excerpt)
you can be sure you're getting the straight story or they will correct me right in the middle so this was labeled a novice talk an intermediate talk and an advanced talk Al together I've uh I put some of each in uh it's got a lot of code in it you don't have to memorize it as it uh goes by I'll actually give you all my slides they're already uploaded they are actually meant to be something that you take back to work and use immediately go through all your codebase and find every where I said don't do this do this instead and swamp it and your code will be beautiful faster more idom and more pythonic and less like C Java C++ and other languages not that those languages are bad they just have different idioms uh uh than we have uh I'm curious how many people in the audience have uh taken a class from me at one point wow I'm I've uh taught over a thousand engineers in the uh uh last year and I've gained an appreciation for what things are really beautiful in Python works great for people so it looks like I've got a number of former students here how many perspective students none oh okay lots of them good enough and as all of my students know practically every example starts out with Raymond equal red Rachel equal blue
On Hacker News
Your mention of simple and clean code makes me think of the excellent talk "Transforming Code into Beautiful, Idiomatic Python". Although it relates to Python programming, if the ideas and principles (and thoughtfulness and pace) from it could be applied to much more written code, then (I think) we as an industry and all our users would be in a better place. [1] - [VIDEO] — jka, 2021-01
I've never heard of Raymond Hettinger before but I'm currently watching one of his videos [1] and it's amazing. Thanks for sharing your list, I'll definitely look up some more of these people. [1] [VIDEO] — bhoeting, 2017-11
Must watch: [VIDEO] I believe that the list comprehension will be faster than filter, but as always, any time you replace readable code with unreadable code for performance reasons, you damn well better time it. — clusmore, 2017-01
For an alternative perspective, allow me to present some classic talks from Raymond Hettinger. First, some generic tips on how to write Python code that's pleasant to work with: [VIDEO] And then this one digs more specifically into how not to write Python like it's Java, starting at 12:40 (with talking about why leading up to that): [LINK] — mumblemumble, 2022-05
These are a few videos which present Pythonic style. They do not form a proper curriculum, but they are example-heavy and give a good insight to a very Pythonic mind. 1. Beyond PEP 8 [LINK] 2. Transforming Code into Beautiful, Idiomatic Python [VIDEO] — greggyb, 2021-11
Related videos
- BOLTR: KitchenAid Mixer. SURPRISE! · AvE · 45:43
- Linus Torvalds on why desktop Linux sucks · gentooman · 11:06
- Raymond Hettinger - Dataclasses: The code generator to end all code generators - PyCon 2018 · PyCon 2018 · 45:08
- Building pi in a World of Slop — Mario Zechner · AI Engineer · 18:25
- Watch electricity hit a fork in the road at half a billion frames per second · AlphaPhoenix · 26:29
- Light Years Ahead | The 1969 Apollo Guidance Computer · TNMoC · 1:21:22
- SQLite: The Database at the Edge of the Network with Dr. Richard Hipp · Method · 59:58
- Netscape Mozilla Documentary 1998 - 2000 ProJect Code Rush - creative common licence · znoopy2k · 56:09
- Lichess founder Thibault Duplessis lectures on Lichess (2017) · Lichess · 43:21
- Principles of Technology Leadership | Bryan Cantrill | Monktoberfest 2017 · RedMonk Tech Events · 51:22
- How Myst Almost Couldn't Run on CD-ROM | War Stories | Ars Technica · Ars Technica · 23:23
- The Mind-Blowing Machines that Stamp Millions of Metal Parts - Smarter Every Day 288 · SmarterEveryDay · 59:12
- Bryan Cantrill on ARC: A Self-Tuning, Low Overhead Replacement Cache [PWL SF] 10/2017 · PapersWeLove · 1:47:35
- Clojure for Java Programmers Part 1 - Rich Hickey · ClojureTV · 1:48:12
- The first 20 hours -- how to learn anything | Josh Kaufman | TEDxCSU · TEDx Talks · 19:27
- Lecture 1 | Modern Physics: Classical Mechanics (Stanford) · Stanford · 47:50
- Joanna Rutkowska: Towards (reasonably) trustworthy x86 laptops · media.ccc.de · 1:02:51