[Python Mastery] What Pythonistas can learn from bestselling authors

Hey there,

I just finished reading Stephen King's "On Writing."

It's a great little book where he shares some of the writing advice and stories he's picked up over the course of his career as a bestselling author.

He goes pretty deeply into the "behind the scenes" of his writing process, what his schedule looks like, etc.

All very interesting stuff. I'd highly recommend the book if you're interested in writing or just want to get a slightly different peek inside Stephen King's brain for a few hours.

Now, why am I telling you this? There's a chapter in the book where he says, in essence, that:

"All writing is re-writing."

That really struck a cord with me.

And I think it applies directly to what you and I do as Python programmers...

Here, let me explain:

One important thing you need to realize is that there's NEVER a "perfect" first draft:

Just like writing, programming is NOT a linear process. It's an iterative one.

You start with a "blank piece of paper"—whether that's a blank .py file or some boilerplate code you pulled from an existing template.

Then you get your first draft down...just get it out:

Maybe it doesn't fulfill all of the requirements yet (usually it doesn't, at least for me.)

Maybe the code you write looks a little "ugly": the formatting is off, the naming is bad, it's too complicated for what it does.

But that's okay.

Stephen King doesn't write a novel in a single pass—and neither do you need to write the perfect program in one go.

Because now you're going to *iterate* on what you've got so far:

You're going add a little more functionality. Make the code a little prettier. Tease out some functions here and there. Add docstrings and comments.

And you're going to keep iterating and making changes until your program is ready to face the day—

Basically, "all programming is re-programming."

Or as Kent Beck (the Test-Driven Development guru) put it:

"Make it run, make it right, make it fast."

This is really a mantra to live (to program) by.

If you look closely you'll find this idea in all kinds of other creative endeavours (except maybe not in sandcastle competitions.)

With "Python Tricks: The Book" you'll discover how to make the most out of this natural "re-writing" phase.

You'll see in detail how to take existing code that "gets the job done" and to refactor and improve it so that it becomes clean and Pythonic:

>> Click here to pick up the best "productivity features" Python has to offer like decorators, lambdas, list comprehensions (and more)

— Dan Bader

Key phrases

Older messages

[Python Dependency Pitfalls] "Re-inventing the wheel" disease

Monday, August 22, 2022

Hey there, PyPI, the Python packaging repository, now contains more than 100000 third-party packages in total. That's an *overwhelming* number of packages to choose from... And this feeling of

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

Friday, August 19, 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 hidden costs of "copy-paste" Python programming

Friday, August 19, 2022

Hey there, Here's a development story that plays out thousands of times each day: Avid Pythonista Max is working on a function to find the 10 oldest files in a nested directory hierarchy. He needs

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

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

🤖 Google Play Pass Is Actually a Great Deal — Samsung's Ecosystem Is as Good as Apple's

Tuesday, April 16, 2024

Also: We Review a Robot Window Cleaner, and More! How-To Geek Logo April 16, 2024 📩 Get expert reviews, the hottest deals, how-to's, breaking news, and more delivered directly to your inbox by

JSK Daily for Apr 16, 2024

Tuesday, April 16, 2024

JSK Daily for Apr 16, 2024 View this email in your browser A community curated daily e-mail of JavaScript news React useState Vs. Context API: When to Use Them React has improved its state management

Pydantic, Web Security, State of Python, and More

Tuesday, April 16, 2024

Pydantic: Simplifying Data Validation in Python #625 – APRIL 16, 2024 VIEW IN BROWSER The PyCoder's Weekly Logo Pydantic: Simplifying Data Validation in Python Discover the power of Pydantic,

Save big - online product conference on May 2nd

Tuesday, April 16, 2024

INDUSTRY Virtual takes place on May 2nd — which includes: Broadcasts of some of our favorite conference talks from the past year from Petra Wille, Kate Leto, Quincy Olatunde, and others — with live

Navigating the Digital Thread: Join Our Exclusive Webinar!

Tuesday, April 16, 2024

Enhancing Collaboration and Efficiency with Windchill, Creo, and Codebeamer View this email in your browser engineering.com Navigating the Digital Thread: Enhancing Collaboration and Efficiency with

Daily Coding Problem: Problem #1414 [Easy]

Tuesday, April 16, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Bloomberg. Determine whether there exists a one-to-one character mapping from one string

Charted | The Declining Value of the U.S. Federal Minimum Wage 📉

Tuesday, April 16, 2024

This graphic compares the nominal vs. inflation-adjusted value of the US minimum wage, from 1940 to 2023. View Online | Subscribe Presented by: The economy is changing. Is your portfolio adapting? >

⚙️ Limitless

Tuesday, April 16, 2024

Plus: OpenAI Japan takeover ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

The latest Go developer survey results are in

Tuesday, April 16, 2024

Plus lots of database stuff, a new Go book is in print, and a Minesweeper implementation. | #​503 — April 16, 2024 Unsub | Web Version If you wondered why you didn't get an issue last week, we took

Noonification: HackerNoons Emoji Credibility Indicators are Live on GitHub and Figma!

Tuesday, April 16, 2024

Top Tech Content sent at Noon! How are you, @newsletterest1? 🪐 What's happening in tech this week: The Noonification by HackerNoon has got you covered with fresh content from our top 5 stories of