What Pythonistas can learn from bestselling horror 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.)

Happy Pythoning!

— Dan Bader

Older messages

New Python tutorials on Real Python

Saturday, September 5, 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 3 Installation & Setup Guide [

New Python tutorials on Real Python

Saturday, August 29, 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 mmap: Improved File I/O With Memory

Learning Python and the Power Of Constraints

Friday, August 28, 2020

Hey there, When I was 15-years old I'd set my mind on becoming the world's greatest guitarist. I was already a huge nerd at the time—so one beautiful Sunday morning I sat down for a few hours

Video subtitles & transcripts now available on Real Python

Thursday, August 27, 2020

Hey there, I've got a big update to share today... Real Python video courses now have full subtitles and transcripts! I think this is going to do a lot for accessibility and making your favorite

New Python tutorials on Real Python

Saturday, August 22, 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: A Practical Introduction to Web Scraping in

You Might Also Like

💻 Issue 445 - Deno vs. Oracle: Canceling the JavaScript Trademark

Thursday, November 28, 2024

This week's Awesome JavaScript Weekly Read this email on the Web The Awesome JavaScript Weekly Issue » 445 Release Date Nov 28, 2024 Your weekly report of the most popular JavaScript news, articles

📱 Issue 439 - Google's iOS app now injects links on third-party websites that go to Search

Thursday, November 28, 2024

This week's Awesome iOS Weekly Read this email on the Web The Awesome iOS Weekly Issue » 439 Release Date Nov 28, 2024 Your weekly report of the most popular iOS news, articles and projects Popular

💻 Issue 363 - 7 challenges to do before a React interview

Thursday, November 28, 2024

This week's Awesome React Weekly Read this email on the Web The Awesome React Weekly Issue » 363 Release Date Nov 28, 2024 Your weekly report of the most popular React news, articles and projects

💻 Issue 445 - Mastering JavaScript Event Delegation

Thursday, November 28, 2024

This week's Awesome Node.js Weekly Read this email on the Web The Awesome Node.js Weekly Issue » 445 Release Date Nov 28, 2024 Your weekly report of the most popular Node.js news, articles and

📱 Issue 442 - Static, Dynamic, Mergeable, oh, my!

Thursday, November 28, 2024

This week's Awesome Swift Weekly Read this email on the Web The Awesome Swift Weekly Issue » 442 Release Date Nov 28, 2024 Your weekly report of the most popular Swift news, articles and projects

💻 Issue 440 - Nio: An Async Runtime for Rust

Thursday, November 28, 2024

This week's Awesome Rust Weekly Read this email on the Web The Awesome Rust Weekly Issue » 440 Release Date Nov 28, 2024 Your weekly report of the most popular Rust news, articles and projects

Data Science Weekly - Issue 575

Thursday, November 28, 2024

Curated news, articles and jobs related to Data Science, AI, & Machine Learning ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

JSK Daily for Nov 28, 2024

Thursday, November 28, 2024

JSK Daily for Nov 28, 2024 View this email in your browser A community curated daily e-mail of JavaScript news Top Linters for JavaScript and TypeScript: Simplifying Code Quality Management Linters are

🦃 iPhone Camera Features Most People Ignore (But Shouldn't) — How to Avoid Overpriced BF Deals

Thursday, November 28, 2024

Also: Nobody Likes Doing Chores Until They're in a Video Game, and More! How-To Geek Logo November 28, 2024 Did You Know You may refer to the general area as just your "ear", but the

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