[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

Older messages

[Python Mastery] The hidden costs of "copy-paste" Python programming

Monday, November 2, 2020

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] What does it mean to "master" Python?

Friday, October 30, 2020

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

Finding the motivation to improve your Python skills?

Friday, October 30, 2020

Hey there, On past newsletter issues I've been going on and on about how becoming great at Python is more like a "marathon" rather than a "sprint"— You can't just plow

New Python tutorials on Real Python

Saturday, October 24, 2020

Hey there, There's always something going on over at realpython.com as far as Python tutorials go. Here's what you may have missed this past week: Python Booleans: Optimize Your Code With Truth

New Python tutorials on Real Python

Monday, October 19, 2020

Hey there, There's always something going on over at realpython.com as far as Python tutorials go. Here's what you may have missed this past week: Using ggplot in Python: Visualizing Data With

You Might Also Like

Daily Coding Problem: Problem #1622 [Hard]

Thursday, November 28, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Amazon. Given an integer k and a string s, find the length of the longest substring that

Mapped | The Average Credit Card Debt in Every U.S. State 💳

Thursday, November 28, 2024

Households in richer states have higher average credit card debt but higher incomes allow them to pay it off faster as well. View Online | Subscribe | Download Our App Presented by: Defiance ETFs

Issue 341 - Free supercharging and FSD offer extended for new Teslas

Thursday, November 28, 2024

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 341 -

Programmer Weekly - Issue 233

Thursday, November 28, 2024

View this email in your browser Programmer Weekly Welcome to issue 233 of Programmer Weekly. Let's get straight to the links this week. Quote of the Week "All programmers are playwrights and

Python Weekly - Issue 678

Thursday, November 28, 2024

View this email in your browser Python Weekly Welcome to issue 678 of Python Weekly. Let's get straight to the links this week. Articles, Tutorials and Talks Let's build a AI Photo Generator

Web Tools #593 - Frameworks, React Tools, Uncats

Thursday, November 28, 2024

WEB VERSION Issue #593 • November 28, 2024 Advertisement Power Your Web Projects with Cloudways This BFCM As a developer, designer, or tech professional, you need reliable hosting that adapts to your

Python Weekly - Issue 678

Thursday, November 28, 2024

View this email in your browser Python Weekly Welcome to issue 678 of Python Weekly. Let's get straight to the links this week. Articles, Tutorials and Talks Let's build a AI Photo Generator

Introducing the Revamped HackerNoon AI Image Gallery

Thursday, November 28, 2024

Top Tech Content sent at Noon! Advertise on this Newsletter! 50% off!! Read this email in your browser How are you, @newsletterest1? 🪐 What's happening in tech today, November 28, 2024? The

Black Friday Giveaway @ Real Python

Thursday, November 28, 2024

Hey there, Just wanted to let you know that we're doing a special giveaway for Black Friday this week at Real Python 🎁🎉 You can get Python education resources worth over $1210, including three

Dispatch 019 🦃

Thursday, November 28, 2024

Watching the Parade • Paying for the Parade • Pirate TV Raid • US v. Microsoft Round 2 • Trump's Anti-Antitrust? • Google Anti-Antitrust The Spyglass Dispatch is a free newsletter sent out daily on