[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

[Sublime + Python Setup] Grumpy old greybeard with a whitespace problem

Friday, September 24, 2021

One fateful day, the Agile Gods that be decided to “add some firepower” to my little team… And so, developer Paul joined (name changed to protect the guilty). Before I dive into this story, let me ask

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

Thursday, September 23, 2021

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

[Sublime + Python Setup] Don’t build “nag screen muscle memory”

Thursday, September 23, 2021

Hey there, Once I worked with a developer who refused to buy a registered copy of Sublime for months on end, even though he *loved* Sublime. He used it as his main code editor every day and was very

[PythonistaCafe] Q&A

Thursday, September 23, 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

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

Wednesday, September 22, 2021

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

You Might Also Like

Post from Syncfusion Blogs on 04/18/2024

Thursday, April 18, 2024

New blogs from Syncfusion What's New in .NET 8 for Developers? By Vinoth Kumar Sundara Moorthy This blog explores the .NET 8 version's groundbreaking new features and compares it with its

Not Your Grandpa’s Hearing Device

Thursday, April 18, 2024

Alarming fact: More than 48 million Americans hear so poorly that their quality of life significantly suffers as a result. The problem: Most wait too long to act, hoping their hearing will improve on

Edge 388: Google DeepMind's SIMA can Follow Language Instructions in 3D Games Just Like Humans

Thursday, April 18, 2024

The AI agent represents a major improvement relative to expensive reinforcement learning methods. ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Third party iOS app stores 📱, Boston Dynamics next-gen bot 🤖, Stable Diffusion 3 API 👨‍💻

Thursday, April 18, 2024

AltStore PAL, a third-party iOS app store, is now live in the EU Sign Up |Advertise|View Online TLDR Together With TLDR TLDR 2024-04-18 Want to advertise in TLDR? (Sponsor) Fortune 50 companies like

Berliner Goes Tabloid 🤬

Thursday, April 18, 2024

The movie that perfectly explains what that NPR editor did. Here's a version for your browser. Hunting for the end of the long tail • April 17, 2024 Berliner Goes Tabloid Considering the tale of

Tuesday Triage #196

Wednesday, April 17, 2024

Your weekly crème de la crème of the Internet is here! The 196th edition featuring Naismith's rule, cow magnet, and Little Sparta. ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

Atlas humanoid robot goes electric 

Wednesday, April 17, 2024

Meta goes back to the drawing board and Tesla does some advertising View this email online in your browser By Christine Hall Wednesday, April 17, 2024 Good afternoon, and welcome to your Hump Day

📞 1990s Technology We Still Use Today — How to Fix Google Maps When It's Not Working

Wednesday, April 17, 2024

Also: Why You Should Buy Last Year's Flagship TV, and More! How-To Geek Logo April 17, 2024 📩 Get expert reviews, the hottest deals, how-to's, breaking news, and more delivered directly to your

Today only: Join Incubator to get these bonuses

Wednesday, April 17, 2024

I'll work with you personally in a small group ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

JSK Daily for Apr 17, 2024

Wednesday, April 17, 2024

JSK Daily for Apr 17, 2024 View this email in your browser A community curated daily e-mail of JavaScript news React useState Vs. Context API: When to Use Them React has improved its state management