[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

iOS Dev Weekly - Issue 661

Friday, May 17, 2024

What's the word on everyone's lips? 🅰️👁️ View on the Web Archives ISSUE 661 May 17th 2024 Comment Did you catch Google I/O this week? It's Always Interesting to see what the Android

Your Google Play recap from I/O 2024

Friday, May 17, 2024

Check out all of our latest updates and announcements Email not displaying correctly? View it online May 2024 Google Play at I/O 2024 Check out the Google Play keynote to discover the latest products

A gorgeous sports watch - with week-long battery life

Friday, May 17, 2024

Microsoft Build; ChatGPT desktop app; Are all Linux vendor kernels insecure? -- ZDNET ZDNET Tech Today - US May 17, 2024 placeholder One of the most gorgeous sports watches I've tested also has

Prioritization beyond the frameworks

Friday, May 17, 2024

​ Scroll down for your weekly product newsletter... but first, we are excited to introduce Gigantic, an on-demand product training platform. ​ On Monday, May 20th, we'll re-launch Gigantic, on-

Webinar: Device health - a key to access control

Friday, May 17, 2024

Join us May 30th ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Noonification: AI, the New Gru

Friday, May 17, 2024

Top Tech Content sent at Noon! Get Algolia: AI Search that understands How are you, @newsletterest1? 🪐 What's happening in tech today, May 17, 2024? The HackerNoon Newsletter brings the HackerNoon

Charted | Visualizing Copper Production by Country 🏅

Friday, May 17, 2024

In this graphic, we illustrate global copper production in 2023, based on data from the US Geological Survey. View Online | Subscribe Presented by Voronoi: The App Where Data Tells the Story FEATURED

Issue #541: xkcd's Machine, Godot web export, and Labor Power

Friday, May 17, 2024

Weekly newsletter about HTML5 Game Development. Is this email not displaying correctly? View it in your browser. Issue #541 - May 17th 2024 If you have anything you want to share with the HTML5 game

Hey ChatGPT: Am I the a**hole?

Friday, May 17, 2024

OpenAI can now trawl Reddit's posts and comments to train its LLM. View this email online in your browser By Rebecca Bellan Friday, May 17, 2024 Welcome to TechCrunch AM! How are we feeling about

⚙️ Hugging Face is donating $10 million of GPUs to developers

Friday, May 17, 2024

Plus: A new study breaks down the biggest barrier to enterprise AI adoption ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌