PLAY PODCASTS
Decomposing Software Problems & Avoiding the Trap of Clever Code
Episode 207

Decomposing Software Problems & Avoiding the Trap of Clever Code

The Real Python Podcast · Real Python

June 7, 202455m 9s

Audio is streamed directly from the publisher (dts.podtrac.com) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.

Show Notes

<p>How do you effectively break a software problem into individual steps? What are signs you&rsquo;re writing overly clever code? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&rsquo;s Weekly articles and projects.</p> <p>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. </p> <p>Christopher discusses an article titled &ldquo;Clever code is probably the worst code you could write.&rdquo; Early in a programming career, it&rsquo;s easier to write complex and difficult-to-read code. The real challenge is progressing towards writing clearer and readable code. </p> <p>We also share several other articles and projects from the Python community, including a news roundup, what the <code>__pycache__</code> folder is for in Python, what&rsquo;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.</p> <p>This episode is sponsored by Sentry.</p> <div class="alert alert-primary" role="alert"> <p><strong>Course Spotlight:</strong> <a href="https://realpython.com/courses/efficient-iterations-iterators-iterables/">Efficient Iterations With Python Iterators and Iterables</a></p> <p>In this video course, you&rsquo;ll learn what iterators and iterables are in Python. You&rsquo;ll learn how they differ and when to use them in your code. You&rsquo;ll also learn how to create your own iterators and iterables to make data processing more efficient.</p> </div> <p>Topics:</p> <ul> <li>00:00:00 &ndash; Introduction</li> <li>00:02:18 &ndash; PEP 667: Consistent Views of Namespaces (Accepted)</li> <li>00:03:08 &ndash; PEP 649 Re-targeted to 3.14</li> <li>00:03:50 &ndash; Untold Stories From 6 Years Working on Python Packaging</li> <li>00:04:38 &ndash; What Is the <code>__pycache__</code> Folder in Python?</li> <li>00:09:57 &ndash; Sponsor: Sentry</li> <li>00:11:04 &ndash; What&rsquo;s New in Django 5.1</li> <li>00:17:48 &ndash; Page Dewarping</li> <li>00:26:55 &ndash; Video Course Spotlight</li> <li>00:28:26 &ndash; Clever Code Is Probably the Worst Code You Could Write</li> <li>00:33:19 &ndash; Software Engineering Hiring and Firing</li> <li>00:51:22 &ndash; Metronomes: An Easy Way to Set Up Regular Tasks</li> <li>00:52:26 &ndash; django-web-components: Create reusable template components in Django</li> <li>00:54:03 &ndash; Thanks and goodbye</li> </ul> <p>News:</p> <ul> <li><a href="https://peps.python.org/pep-0667/">PEP 667: Consistent Views of Namespaces (Accepted)</a></li> <li><a href="https://peps.python.org/pep-0649/">PEP 649 Re-targeted to 3.14</a> &ndash; Python Enhancement Proposal 649: Deferred Evaluation Of Annotations Using Descriptors has been re-targeted to the Python 3.14 release</li> <li><a href="https://harihareswara.net/posts/2024/references-pycon-us-keynote/">Untold Stories From 6 Years Working on Python Packaging</a> &ndash; Sumana gave the closing keynote address at PyCon US this year and this posting shares all the links and references from the talk.</li> </ul> <p>Show Links:</p> <ul> <li><a href="https://realpython.com/python-pycache/">What Is the <code>__pycache__</code> Folder in Python?</a> &ndash; In this tutorial, you&rsquo;ll explore Python&rsquo;s <code>__pycache__</code> folder. You&rsquo;ll learn about when and why the interpreter creates these folders, and you&rsquo;ll customize their default behavior. Finally, you&rsquo;ll take a look under the hood of the cached .pyc files.</li> <li><a href="https://micro.webology.dev/2024/05/22/whats-new-in.html">What&rsquo;s New in Django 5.1</a> &ndash; 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.</li> <li><a href="https://mzucker.github.io/2016/08/15/page-dewarping.html">Page Dewarping</a> &ndash; This article shows the techniques behind a page flattening algorithm. It starts with images of a book&rsquo;s page which are curled from the spine of the book, and creates a resulting PDF that is a flat version.</li> <li><a href="https://read.engineerscodex.com/p/clever-code-is-probably-the-worst">Clever Code Is Probably the Worst Code You Could Write</a> &ndash; 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.</li> </ul> <p>Discussion:</p> <ul> <li><a href="https://edcrewe.blogspot.com/2024/04/software-engineering-hiring-and-firing.html">Software Engineering Hiring and Firing</a> &ndash; 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&rsquo;t a &ldquo;first job&rdquo; post, but a &ldquo;how the decision process works&rdquo; article.</li> </ul> <p>Projects:</p> <ul> <li><a href="https://github.com/pomponchik/metronomes">Metronomes: An Easy Way to Set Up Regular Tasks</a></li> <li><a href="https://github.com/Xzya/django-web-components">django-web-components: A simple way to create reusable template components in Django</a></li> </ul> <p>Level up your Python skills with our expert-led courses:</p> <ul> <li><a href="https://realpython.com/courses/django-portfolio-project/">Getting Started With Django: Building a Portfolio App</a></li> <li><a href="https://realpython.com/courses/efficient-iterations-iterators-iterables/">Efficient Iterations With Python Iterators and Iterables</a></li> <li><a href="https://realpython.com/courses/python-for-loop/">For Loops in Python (Definite Iteration)</a></li> </ul> <p><a rel="payment" href="https://realpython.com/join">Support the podcast &amp; join our community of Pythonistas</a></p>