[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

[Sublime + Python Setup] How to become a happier & more productive Python dev

Friday, August 5, 2022

Hey there, I really struggled with setting up an effective development environment as a new Python developer. It was difficult to build the right habits and to find a set of tools I enjoyed to use.

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

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

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

Friday, August 5, 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] How to set the world on fire

Thursday, August 4, 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

[Python Mastery] The secret to "ethical self-promotion"?

Thursday, August 4, 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

Shift+Enter Is a Secret Shortcut Everyone Should Know

Thursday, August 18, 2022

Did You Know?: Mathematically, it's possible for each area code in the United States to support a maximum of 8000000 telephone numbers. Practically, however, the number is slightly less than that (

iOS Privacy Facebook and Instagram, Lenses and Prisms in Swift, Async Let, Conditional SwiftUI Layouts, Apple September Event Date Rumours

Thursday, August 18, 2022

One more thing... Hello, you're reading Infinum iOS Cocoa Treats, bringing you the latest iOS related news straight to your inbox every week. iOS Privacy: Instagram and Facebook can track anything

Issue 229 - 500 miles Tesla semi this year, Cybertruck next

Thursday, August 18, 2022

View this email in your browser If you are just now finding out about Tesletter, you can subscribe here! If you already know Tesletter and want to support us, check out our Patreon page Issue 229 - 500

Noonification: Key Facts About Noonies 2022

Thursday, August 18, 2022

Top Tech Content sent at Noon Free eBook: Try Infrastructure as Code The Noonification: Your Daily Dose of Electrifying Tech Content at Noon, by HackerNoon Hey there, 🪐 What's happening in tech

This '80s song could crash your laptop

Thursday, August 18, 2022

New iPhone release date; Best robot vacuum deals... ZDNET ZDNET Tech Today - US August 18, 2022 placeholder Don't let Janet Jackson's 'Rhythm Nation' crash your old laptop Here's

Programmer Weekly - Issue 118

Thursday, August 18, 2022

View this email in your browser Programmer Weekly Welcome to issue 118 of Programmer Weekly. Let's get straight to the links this week. Quote of the Week "The most secure code in the world is

VisualStudio.Extensibility Announced, Microsoft Leads in Cloud AI Dev Services, VS 2022 for Mac 17.3 GA, More

Thursday, August 18, 2022

Home | News | How To | Webcasts | Whitepapers | Advertise .NET Insight August 18, 2022 THIS ISSUE SPONSORED BY: ■ Modern Software Installation with InstallShield ■ dtSearch® - INSTANTLY SEARCH

Web Tools #474 - JS Libraries, SVG, Git/CLI

Thursday, August 18, 2022

Web Tools Weekly WEB VERSION Issue #474 • August 18, 2022 Advertisement Build Internal Tools 10x Faster with Retool Retool is the fast way for developers to build and share internal tools. Teams at

Python Weekly - Issue 563

Thursday, August 18, 2022

View this email in your browser Python Weekly Welcome to issue 563 of Python Weekly. Let's get straight to the links this week. From Our Sponsor Get Your Weekly Dose of Programming A weekly

Open source tools for K8s, Kafka, React, Rails, and more

Thursday, August 18, 2022

StackShare Weekly Email not displaying correctly? View it in your browser. StackShare Weekly Digest August 18th, 2022 Sponsored by Sentry. From controlling chaotic workflows to maintaining stable code,