[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

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

Friday, September 9, 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

Thursday, September 8, 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] The secret to "ethical self-promotion"?

Thursday, September 8, 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 Mastery] What does it mean to "master" Python?

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

Wednesday, September 7, 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

You Might Also Like

Edge 389: Understanding Large Action Models

Tuesday, April 23, 2024

One of the most important concepts in autonomous agents. ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Apple World Cup bid ⚽, Meta opens VR OS 🌎, Anthropic's prompt library 🤖

Tuesday, April 23, 2024

Apple is working to secure an exclusive TV deal with FIFA Sign Up |Advertise|View Online TLDR Together With WorkOS TLDR 2024-04-23 WorkOS is the only auth provider your B2B SaaS app needs to start

New Blogs on ThomasMaurer.ch for 04/23/2024

Tuesday, April 23, 2024

View this email in your browser Thomas Maurer Cloud & Datacenter Update This is the update for blog posts on ThomasMaurer.ch. Cloud operations for Windows Server through Azure Arc By Thomas Maurer

Post-Post 🗨️

Tuesday, April 23, 2024

Assessing the post-Twitter climate amid Post.News' shutdown. Here's a version for your browser. Hunting for the end of the long tail • April 22, 2024 Post-Post The demise of Post, one of the

BetterDev #257 - Building a GPS Receiver

Monday, April 22, 2024

Better Dev #257 Apr 22, 2024 Hi all, We come back with a new issue this week. If you like BetterDev, please help spead word out by refer to your friends. Buy me a coffee would be great too. This week I

Tomorrow's Free Notes Class: How to sign up!

Monday, April 22, 2024

Hi there, Tomorrow we will be hosting a Free Notes App Class. This is your last chance to register for tomorrow's live class and learn how to get the most out of your Notes app. Our experienced

Elon’s ‘balls to the wall’ autonomy push

Monday, April 22, 2024

Plus: Amazon ends California drone deliveries and Rippling's founder has a brand-new bag View this email online in your browser By Christine Hall Monday, April 22, 2024 Image Credits: Toru Hanai/

📱 Your iPhone is Now Discoverable by Others — Tips for Building Your First PC

Monday, April 22, 2024

Also: How to Play Windows Games on Your Mac, and More! How-To Geek Logo April 22, 2024 📩 Get expert reviews, the hottest deals, how-to's, breaking news, and more delivered directly to your inbox by

JSK Daily for Apr 22, 2024

Monday, April 22, 2024

JSK Daily for Apr 22, 2024 View this email in your browser A community curated daily e-mail of JavaScript news It Is so Cool to Develop React Native With Expo 1. What are the benefits of Expo?. "

😺 The social walkie-talkie

Monday, April 22, 2024

Hi, hi! It's Monday and it's Earth Day! Don't miss the Cat Nips section below for innovative products in the... Product Hunt Read in browser This newsletter is brought to you by YOU MIGHT