[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.

Key phrases

Older messages

[Python Mastery] Learn Python in 21 days!!!!11 (what a lie)

Wednesday, June 22, 2022

Hey there, One of the first programming books I ever bought was "Teach Yourself C in 21 Days." This four pound tome came with a CD-ROM that included an ancient version (3.1) of the Borland

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

Wednesday, June 22, 2022

Hey there, 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

[PythonistaCafe] What's in PythonistaCafe for you?

Wednesday, June 22, 2022

Hey there, 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 Mastery] The secret to "ethical self-promotion"?

Tuesday, June 21, 2022

Hey there, Here's some food for thought: There's a difference between *doing* a great job as a Python developer, and *to be seen doing* a great job. Being a skilled developer among peers—and

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

Tuesday, June 21, 2022

Hey there, #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

CryptoPage Newsletter - Issue 106

Sunday, September 26, 2021

Crypto Daily News - September 26, 2021 View on the Web Archives ISSUE 106 September 26th 2021 Crypto News Is the China ban 'a precursor' to a similar turn of events in the US Voyager

is there such a thing as good hacking?

Tuesday, September 21, 2021

TikTok's machines don't think so View this email in your browser WELLNESS CHECK This edition leans... Hey Below the Fold fam, In a poll last week, we asked you if social media companies should

🧬 One iconic, extinct animal could return to Earth

Monday, September 20, 2021

Plus: A conversation with the director of Netflix's Inspiration4 mission documentary. ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

♦️⚡️♦️ Databricks' New ML Announcements

Sunday, July 3, 2022

Databricks has been one of the companies that have been at the center of the big data movement, pioneering technologies such as Apache Spark. Machine learning (ML) has been a native component of Spark

MuteMe button/Quick Clot/Podchaser

Sunday, July 3, 2022

Recomendo Recomendo July 3 · Issue #313 · View online A weekly newsletter that gives you 6 brief personal recommendations of cool stuff. For a searchable archive of past issues check out https://

Kotlin Weekly #309

Sunday, July 3, 2022

ISSUE #309 3rd of July 2022 Hello from Italy Kotliners (where the weather forecast has been everything but right). The KotlinConf has been finally announced, and the early and super early tickets are

[Python Mastery] The hidden costs of "copy-paste" Python programming

Sunday, July 3, 2022

Hey there, Here's a development story that plays out thousands of times each day: Avid Pythonista Max is working on a function to find the 10 oldest files in a nested directory hierarchy. He needs

Weekend Reading — Just hacks all the way down

Sunday, July 3, 2022

This week we ride on one and two half wheels, design a responsive snake, locate our headphones, and dance to the ring tone. Weekend Reading — Just hacks all the way down By Assaf Arkin – 02 Jul 2022 –

There are no open issues or pull requests on Flask — Learn TLA+ — and The GPU shortage is over

Saturday, July 2, 2022

Issue #816 — Top 20 stories of July 03, 2022 Issue #816 — July 03, 2022 You receive this email because you are subscribed to Hacker News Digest. You can open it in the browser if you prefer. 1 There

JSK Daily for Jul 2, 2022

Saturday, July 2, 2022

JSK Daily for Jul 2, 2022 View this email in your browser A community curated daily e-mail of JavaScript news Angular State Management with NgRx State management is the process of managing the states

Daily Coding Problem: Problem #806 [Hard]

Saturday, July 2, 2022

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Google. Let A be an N by M matrix in which every row and every column is sorted. Given i

Infographic | A Logarithmic Map of the Entire Observable Universe 🌌

Saturday, July 2, 2022

Scientists believe we've only discovered about 5% of the universe. Here's a map of what we've found so far, visualized using a log scale. View Online | Subscribe Presented by: Do You

What Are the Best Nintendo Switch Games in 2022?

Saturday, July 2, 2022

Did You Know?: Before it was destroyed at the end of February 2022, the cargo hold of the world's largest cargo plane, the Antonov An-225 Mriya, was 142 feet 2 inches (43.35 meters) in length—22