[Python Dependency Pitfalls] Artisanal "from-scratch" development

Hey there,

The other day I got this question from Newsletter member Newvick in my email inbox:

~~~

I'm trying to get past the beginner's stage in Python and one problem I have is:

When do you use libraries/frameworks and when do you make things from scratch? (whether for learning or developing something for a client/work)

~~~

When to code functionality from scratch and when to use libraries, that's an important question.

There's a fine balance you need to strike here:

When I learned how to program I was "reinventing wheels" left and right—and it pushed my abilities forward quickly.

I was constantly writing all kinds of existing functionality from scratch and it was the right thing to do because it helped me grow my skills.

It was a great learning exercise.

But there comes a time in a developer's life when that strategy doesn't work so well any more:

Eventually I found that I wasn't learning as quickly anymore trying to build everything from scratch.

Plus my development pace was dog-slow.

I was spinning my wheels—and my productivity began to plateau.

Another downside is this:

It's difficult to work on a team when someone always wants to approach every single problem from first principles. It can drive coworkers and managers NUTS.

These days I try to use (good quality + well-documented!) third-party libraries where possible.

But again, you'll want to find a balance there:

For example, any professional chef worth their salt needs to learn how to make mayonnaise from scratch.

But eventually they'll know how to prepare it—and what great quality looks like.

From this point on buying pre-made mayo off the shelf can be a huge time saver:

In some dishes it simply WON'T make a difference on the end result.

It just *takes longer* to make everything from scratch…

Bringing it back to Python dependency management, here's my general rule of thumb:

"Only consider 'write from scratch' if time is NOT an issue. Otherwise use 3rd-party libraries and frameworks—but don't overdo it and only go for the trustworthy ones."

(Remember, you'll want to avoid another "left-pad" incident.)

Sometimes it's just tough as nails to strike the right balance here…and there's so much more to talk about on this topic.

If you want to dig deep and see how to make the leap from "amateur cook" to "professional chef" as a Pythonista, my Managing Python Dependencies course shows you how to get there.

It includes a complete step-by-step workflow for researching packages and making Python dependency decisions (and explaining them to your team, manager, or client).

Click the link below to learn more:

realpython.com/products/managing-python-dependencies/

— Dan Bader

P.S. "Re-inventing the wheel" disease was really something I struggled with as a fledgling dev. I'll show you how I got over it tomorrow.

Older messages

[Sublime + Python Setup] why Atom can’t replace Sublime

Friday, May 14, 2021

Hey there, "In a nutshell, Atom is a Sublime Text editor that just got better." When I read this quote I got so worked up I nearly fell off my chair. Because every time I've tried Atom or

[Sublime + Python Setup] How to become a happier & more productive Python dev

Friday, May 14, 2021

Hey there, I really struggled with setting up an effective development environment as a new Python developer. It was difficult to build the right habits and to find a set of tools I enjoyed to use.

[Python Dependency Pitfalls] A total mess?

Friday, May 14, 2021

Hey there, Recently I watched a Pythonista ask for advice on setting up a Python project on his work machine. This new developer had some prior experience with NodeJS and had just started to get his

[PythonistaCafe] Q&A

Friday, May 14, 2021

Hey there, At this point you should have a pretty good idea of what PythonistaCafe is about and what makes it special. In this email I want to answer some common questions that I get asked about the

[PythonistaCafe] What makes PythonistaCafe different

Friday, May 14, 2021

Hey there, Mastering Python is *not* just about getting the books and courses to study—to be successful you also need a way to stay motivated and to grow your abilities in the long run. Many

You Might Also Like

Yikes! Copilot failed all our coding tests

Monday, April 29, 2024

iPad Pro with M4; Best security keys; AI conducts job interviews now -- ZDNET ZDNET Tech Today - US April 29, 2024 placeholder Yikes! Microsoft Copilot failed every single one of my coding tests I ran

Re: The smart home product I use every day!

Monday, April 29, 2024

Hey , Earlier this month, I emailed you about one of my favorite smart home products, a robot vacuum and mop. I wanted to let you know that Samsung currently has a Spring Black Friday Sale and is

The EU draws its regulatory cords tighter around Apple

Monday, April 29, 2024

The EU has said Apple's iPadOS will now fall under the DMA View this email online in your browser By Alex Wilhelm Monday, April 29, 2024 Welcome to TechCrunch AM! We're off to a quick start

GCP Newsletter #396

Monday, April 29, 2024

Welcome to issue #396 April 29th, 2024 News Networking Official Blog Partners Introducing the Verified Peering Provider program, a simple alternative to Direct Peering - Google has launched a new

How many Vision Pro headsets has Apple sold?

Monday, April 29, 2024

The Morning After It's Monday, April 29, 2024. Apple Vision Pro headset production is reportedly being cut, sales are reportedly “way down.” But but but wait: Wasn't the Vision Pro meant to

Okta Warns of Unprecedented Surge in Proxy-Driven Credential Stuffing Attacks

Monday, April 29, 2024

THN Daily Updates Newsletter cover Webinar -- Uncovering Contemporary DDoS Attack Tactics -- and How to Fight Back Stop DDoS Attacks Before They Stop Your Business... and Make You Headline News.

Import AI 370: 213 AI safety challenges; everything becomes a game; Tesla's big cluster

Monday, April 29, 2024

Are AI systems more like religious artifacts or disposable entertainment? ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Apple renews OpenAI talks 🧠, Google fires Python team 👨‍💻, React 19 beta ⚛️

Monday, April 29, 2024

Apple has renewed discussions with OpenAI to use its generative AI technology to power new features coming to the iPhone Sign Up |Advertise|View Online TLDR Together With QA Wolf TLDR 2024-04-29 😘 Kiss

Architecture Weekly #177 - 29nd April 2024

Monday, April 29, 2024

How do you make predictions about tech without the magical crystal ball? We did that today by example. We analysed what Redis and Terraform license changes relate to the new Typescript framework Effect

Software Testing Weekly - Issue 217

Monday, April 29, 2024

How do you deal with conflicts in QA? ⚔️ View on the Web Archives ISSUE 217 April 29th 2024 COMMENT Welcome to the 217th issue! How do you deal with conflicts in QA? Ideally, you'd like to know how