[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

[PythonistaCafe] Why PythonistaCafe exists

Friday, July 29, 2022

Hey there, In one of my last emails I talked about how some online communities in the tech space devolve over time and turn into cesspools of negativity. This relates directly to how and why I started

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

Friday, July 29, 2022

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

[PythonistaCafe] What makes PythonistaCafe different

Thursday, July 28, 2022

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

[PythonistaCafe] Q&A

Thursday, July 28, 2022

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] What dev managers expect from Python candidates

Thursday, July 28, 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

Laravel + WordPress, Silver Play Button and More

Thursday, August 18, 2022

Hey hey, So today is an important day for me, as I have unboxed my Youtube Silver Play button for 100000 subscribers, still can't believe it. Meanwhile, business as usual, will still keep putting

Migrate your Elasticsearch data across clusters with zero downtime

Thursday, August 18, 2022

Deep dive on migrating data effectively using CCS and CCR elastic | Search. Observe. Protect Cloud migration workflow using CCS and CCR Register now Date & Time September 8, 2022 1:30 pm SGT, 3:30

Physical buttons outperform touchscreens in new cars, test finds — RavynOS – Finesse of macOS, freedom of FreeBSD — and VPNs on iOS are a scam

Wednesday, August 17, 2022

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

Google will unplug its IoT Core service in August 2023

Wednesday, August 17, 2022

TechCrunch Newsletter TechCrunch logo The Daily Crunch logo By Christine Hall and Haje Jan Kamps Wednesday, August 17, 2022 Hellooo, Crunchy McCrunchface! (What we're calling the readers of the

Explained | The Relationship Between Climate Change and Wildfires 🔥

Wednesday, August 17, 2022

More carbon in the atmosphere is creating a hotter world—and gradually fueling both climate change and instances of wildfires. View Online | Subscribe FEATURED STORY The Relationship Between Climate

New Webinar! SIMULIA Structural Simulation in Consumer Electronics Design

Wednesday, August 17, 2022

Streamline design cycles and get to market faster View this email in your browser engineering.com Robust Mobile Devices: SIMULIA Structural Simulation in Consumer Electronics Design Live Webinar -

JSK Daily for Aug 17, 2022

Wednesday, August 17, 2022

JSK Daily for Aug 17, 2022 View this email in your browser A community curated daily e-mail of JavaScript news Implementing Route Protection in Angular using CanActivate In any complex web application,

JSK Weekly - August 17, 2022

Wednesday, August 17, 2022

Sometimes less is more and this week Coding Beauty shows us "14 Sensational JavaScript One-Liners That Will Show Your Wizardry", why not give them a bash? Other popular stories this week

HTG Deals: Pixel 6 Pro Drops to Lowest Price Ever, Plus More

Wednesday, August 17, 2022

Logo for How-To Geek Deals August 17, 2022 HTG Deals: Pixel 6 Pro Drops to Lowest Price Ever, Plus More Tech news has been heating up in this final month of summer, with Samsung showing off their

Welcome to ZDNET's next chapter

Wednesday, August 17, 2022

Virtual interviews: 5 ways to make a great impression... ZDNET ZDNET Tech Today - US August 17, 2022 editor's note Today, ZDNET unveiled the biggest upgrade in the 31-year history of the brand,