[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] The Ctrl+s "Heisenbug"

Thursday, September 29, 2022

"What the **** is going on?!" I heard Keith yell. Returning from my lunch break and in a helpful mood I grabbed my coffee mug and shuffled over to my coworker's desk. "What's

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

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

[Python Mastery] What does it mean to "master" Python?

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

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

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

Tuesday, September 27, 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

Elon Musk claims Apple 'threatened to withhold’ Twitter app

Tuesday, November 29, 2022

The Morning After Now available on your smart speaker and wherever you get your podcasts Apple Podcasts | Spotify | Google Play | iHeart Radio It's Tuesday, November 29, 2022. Elon Musk claims that

Those Giant Car Bows Are Totally Real and You Can Buy One

Tuesday, November 29, 2022

Read in Browser Logo for Review Geek November 29, 2022 If you've ever bought a gigantic present for someone so large that wrapping it in paper would be about as much effort as painting your house,

Post from Syncfusion Blogs on 11/29/2022

Tuesday, November 29, 2022

New blogs from Syncfusion Preact vs. React Top 15 VS Code Extensions Every Developer Should Know More from the Syncfusion Ecosystem Bold Reports: Paginated Reports and Analytics Bold Desk: Customizable

📃 Edge#247: Classifying ML Interpretability Methods

Tuesday, November 29, 2022

In this issue: we classify ML interpretability methods; we explore the building blocks of interpretability by Google Research; we explain TensorWatch, an open-source framework for debugging ML models.

Tesla Model 3 redesign 🚗, new GPT-3 released 🤖, lessons from being laid off 👨‍💻

Tuesday, November 29, 2022

Telsa is developing a revamped version of the Model 3. Sign Up | View Online | Sponsor Daily Update 2022-11-29 New survey reveals % of business decisions made based on actual data (Sponsor) Is '

Give back to open source on Giving Tuesday, 3 Git commands to level up your skill, and more

Tuesday, November 29, 2022

Write a C++ extension module for Python Write a C++ extension module for Python Opensource.com THE LATEST Give back to open source on Giving Tuesday Here are 18 ways to support and donate to free and

Power BI Weekly #184 - 29th November 2022

Tuesday, November 29, 2022

Power BI Weekly Newsletter Issue #184 powered by endjin Welcome to the 184th edition of Power BI Weekly! Absolutely no word from the Power BI team this week, so we'll jump straight into the

DeveloPassion's Newsletter - Black Friday Experiments

Tuesday, November 29, 2022

Hello everyone! I'm Sébastien Dubois, your host. You're receiving this email because you signed up fo DeveloPassion's Newsletter - Black Friday Experiments By Sébastien Dubois • Issue #97 •

[Last chance to register] Future-proof your observability platform with OpenTelemetry and Elastic

Tuesday, November 29, 2022

Join our Nov. 30 webinar to learn more. ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ elastic | Search. Observe. Protect Future-proof your observability platform with OpenTelemetry and Elastic

Guide to FFmpeg — Photography for geeks — and Git Notes

Monday, November 28, 2022

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