[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

[PythonistaCafe] Q&A

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

Saturday, August 28, 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”

Saturday, August 28, 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] What's in PythonistaCafe for you?

Friday, August 27, 2021

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 Dependency Pitfalls] How to set the world on fire

Friday, August 27, 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

Microsoft Outlook Flaw Exploited by Russia's APT28 to Hack Czech, German Entities

Saturday, May 4, 2024

THN Daily Updates Newsletter cover Webinar -- Data Security is Different at the Petabyte Scale Discover the secrets to securing fast-moving, massive data sets with insights from industry titans

Stop spam texts today!

Saturday, May 4, 2024

Have you been receiving a ton of spam texts lately? In April alone, spammers sent out over 19.2 billion texts. Ever wonder where they get your info to begin with? Data brokers. They sell your address,

DeveloPassion's Newsletter #165 - She Said Yes ❤️

Saturday, May 4, 2024

Edition 165 of my newsletter, discussing Knowledge Management, Knowledge Work, Zen Productivity, Personal Organization, and more! Sébastien Dubois DeveloPassion's Newsletter DeveloPassion's

📧 Implementing API Gateway Authentication With YARP

Saturday, May 4, 2024

​ Implementing API Gateway Authentication With YARP Read on: m​y website / Read time: 5 minutes BROUGHT TO YOU BY ​ Supercharging Development With AI and APIs ​ ​Announcing Postman v11: Streamline API

Software Testing Weekly - Issue 218

Friday, May 3, 2024

Unit, Integration and End-to-End Tests 🔧 View on the Web Archives ISSUE 218 May 4th 2024 COMMENT Welcome to the 218th issue! I loved going through this discussion among software engineers: What is your

gpt2-chatbot and OpenAI search engine - Weekly News Roundup - Issue #465

Friday, May 3, 2024

Plus: Med-Gemini; Vidu - Chinese answer to OpenAI's Sora; the first race of Abu Dhabi Autonomous Racing League; deepfaking celebrities to teach math and physics; and more! ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

NASA comes to the rescue of crowded rocket launch sites

Friday, May 3, 2024

Plus: Fisker's legal woes and Sprinklr lays off 100 View this email online in your browser By Christine Hall Friday, May 3, 2024 Good afternoon, and welcome to TechCrunch PM. We made it to Friday,

🎮 Forget the PS5 Pro, I Still Love My PS4 — The Best Lock Screen Widgets for iPhone

Friday, May 3, 2024

Also: Smart Home Mistakes to Avoid, and More! How-To Geek Logo May 3, 2024 Did You Know Half of the world's geysers are located in Yellowstone National Park. 🔑 More Passkeys Happy Friday! You can

JSK Daily for May 3, 2024

Friday, May 3, 2024

JSK Daily for May 3, 2024 View this email in your browser A community curated daily e-mail of JavaScript news The Power of React's Virtual DOM: A Comprehensive Explanation Modern JavaScript

Musk raises $6B for AI startup

Friday, May 3, 2024

Also, is TikTok dodging Apple's commissions? View this email online in your browser By Haje Jan Kamps Friday, May 3, 2024 Welcome to Startups Weekly — Haje's weekly recap of everything you can