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

Hey Reader,

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:

dbader.org/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

[Python Dependency Pitfalls] What dev managers expect from Python candidates

Saturday, April 25, 2020

Hey Reader, My friend Og is a senior manager at Red Hat and works with a large team of developers and quality engineers using Python. I got to pick his brain on what he thought were the most important

[🐍PyTricks]: Measure the execution time of small bits of Python code with the "timeit" module

Saturday, April 25, 2020

# The "timeit" module lets you measure the execution # time of small bits of Python code >>> import timeit >>> timeit.timeit('"-".join(str(n) for n in range(

A story about Python mastery

Friday, April 24, 2020

Hey Reader, A couple of years ago I'd become quite interested in martial arts. Hours upon hours of watching "The Karate Kid" growing up must've taken their toll on me... And so, I

[Python Dependency Pitfalls] How to set the world on fire

Friday, April 24, 2020

Hey Reader, #1 on my list of dependency management pitfalls is there for a good reason: It lead to a single developer causing mayhem and breaking thousands of open-source projects around the world in

A "Pythonic" rant?

Wednesday, April 22, 2020

Hey Reader, "Why is Python dependency management so sh*t?" This is a quote that I recently heard from another developer. You know I *love* Python so hearing this instantly made me feel

You Might Also Like

Have VPN connection issues? This might be why

Thursday, May 2, 2024

DJI Power station; Studying with AI; Best gaming PCs -- ZDNET ZDNET Tech Today - US May 2, 2024 placeholder Having VPN connection issues? Microsoft warns the April 2024 Windows update is to blame If

Programmer Weekly - Issue 203

Thursday, May 2, 2024

View this email in your browser Programmer Weekly Welcome to issue 203 of Programmer Weekly. Let's get straight to the links this week. Quote of the Week "The hardest part of design is keeping

Python Weekly - Issue 648

Thursday, May 2, 2024

View this email in your browser Python Weekly Welcome to issue 648 of Python Weekly. Let's get straight to the links this week. News Fake job interviews target developers with new Python backdoor A

A new approach to access management for the way we work today

Thursday, May 2, 2024

Announcing 1Password® Extended Access Management ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Web Tools #563 - Frameworks, JSON/DB Tools, Vue, Nuxt.js

Thursday, May 2, 2024

WEB VERSION Issue #563 • May 2, 2024 Advertisement The Complete JavaScript Course 2024: From Zero to Expert This is an up-to-date JavaScript course covering modern techniques and features that will

Venture capitalists love musical chairs

Thursday, May 2, 2024

A number of investors have been swapping gigs and bouncing from prior employers to build new investing groups. View this email online in your browser By Alex Wilhelm Thursday, May 2, 2024 Good morning,

Gemini in Android Studio and more: Android Studio Jellyfish is Stable!

Thursday, May 2, 2024

View in browser 🔖 Articles Gemini in Android Studio and more: Android Studio Jellyfish is Stable! Android Studio Jellyfish (2023.3.1) is making waves with its official stable release! 🪼🌊 Dive into

wpmail.me issue#665

Thursday, May 2, 2024

wpMail.me wpmail.me issue#665 - The weekly WordPress newsletter. No spam, no nonsense. - May 2, 2024 Is this email not displaying correctly? View it in your browser. News & Articles Why Should You

PHPWeekly May 2nd 2024

Thursday, May 2, 2024

Curated news all about PHP. Here's the latest edition Is this email not displaying correctly? View it in your browser. PHP Weekly 2nd May 2024 Hi everyone, Hope you're all well. This week we

'No one should buy the Ai Pin'

Thursday, May 2, 2024

🖖 Star Trek fans weep ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌