Episode 207: Decomposing Software Problems & Avoiding the Trap of Clever Code
The Real Python Podcast
Jun 07, 2024 55m
How do you effectively break a software problem into individual steps? What are signs you’re writing overly clever code? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
Episode Sponsor:
We discuss an article about de-warping images of book pages. We both found the piece a good study on decomposing a complex software problem.
Christopher discusses an article titled “Clever code is probably the worst code you could write.” Early in a programming career, it’s easier to write complex and difficult-to-read code. The real challenge is progressing towards writing clearer and readable code.
We also share several other articles and projects from the Python community, including a news roundup, what the __pycache__
folder is for in Python, what’s new in Django 5.1, a discussion about software engineering hiring and firing, a project for setting up repeated tasks, and a simple way to create reusable template components in Django.
This episode is sponsored by Sentry.
Course Spotlight: Efficient Iterations With Python Iterators and Iterables
In this video course, you’ll learn what iterators and iterables are in Python. You’ll learn how they differ and when to use them in your code. You’ll also learn how to create your own iterators and iterables to make data processing more efficient.
Topics:
- 00:00:00 – Introduction
- 00:02:18 – PEP 667: Consistent Views of Namespaces (Accepted)
- 00:03:08 – PEP 649 Re-targeted to 3.14
- 00:03:50 – Untold Stories From 6 Years Working on Python Packaging
- 00:04:38 – What Is the
__pycache__
Folder in Python? - 00:09:57 – Sponsor: Sentry
- 00:11:04 – What’s New in Django 5.1
- 00:17:48 – Page Dewarping
- 00:26:55 – Video Course Spotlight
- 00:28:26 – Clever Code Is Probably the Worst Code You Could Write
- 00:33:19 – Software Engineering Hiring and Firing
- 00:51:22 – Metronomes: An Easy Way to Set Up Regular Tasks
- 00:52:26 – django-web-components: Create reusable template components in Django
- 00:54:03 – Thanks and goodbye
News:
- PEP 667: Consistent Views of Namespaces (Accepted)
- PEP 649 Re-targeted to 3.14 – Python Enhancement Proposal 649: Deferred Evaluation Of Annotations Using Descriptors has been re-targeted to the Python 3.14 release
- Untold Stories From 6 Years Working on Python Packaging – Sumana gave the closing keynote address at PyCon US this year and this posting shares all the links and references from the talk.
Show Links:
- What Is the
__pycache__
Folder in Python? – In this tutorial, you’ll explore Python’s__pycache__
folder. You’ll learn about when and why the interpreter creates these folders, and you’ll customize their default behavior. Finally, you’ll take a look under the hood of the cached .pyc files. - What’s New in Django 5.1 – Django 5.1 has gone alpha so the list of features targeting this release has more or less solidified. This article introduces you to what is coming in Django 5.1.
- Page Dewarping – This article shows the techniques behind a page flattening algorithm. It starts with images of a book’s page which are curled from the spine of the book, and creates a resulting PDF that is a flat version.
- Clever Code Is Probably the Worst Code You Could Write – When you come across a clever bit of code, it is hard not to admire it, but often times, clear, readable code is the hardest code to write.
Discussion:
- Software Engineering Hiring and Firing – This article is a deep dive on the hiring and firing practices in the software field, and unlike most articles focuses on senior engineering roles. It isn’t a “first job” post, but a “how the decision process works” article.
Projects:
- Metronomes: An Easy Way to Set Up Regular Tasks
- django-web-components: A simple way to create reusable template components in Django