[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

Sunday, November 13, 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)

Saturday, November 12, 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 Mastery] The secret to "ethical self-promotion"?

Friday, November 11, 2022

Hey there, Here's some food for thought: There's a difference between *doing* a great job as a Python developer, and *to be seen doing* a great job. Being a skilled developer among peers—and

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

Thursday, November 10, 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

[Python Dependency Pitfalls] The Iceberg

Tuesday, November 8, 2022

Hey there, The other day I read this quote from a Python developer that made me stop and think: "As a noob with a little programming knowledge already, I've found setting up and installing

Get Set, Grow Your Company's Online Reputation

Friday, December 9, 2022

Bear Market(ing) Diaries Vol.2 🐻 Hey Team 👋🏽 Q4 2022 has been INTERESTING, won't you agree? We've witnessed so many billionaires f*ck up - but the ultimate winner this season was the FTX

Data Science Weekly - Issue 472

Friday, December 9, 2022

Curated news, articles and jobs related to Data Science. Keep up with all the latest developments Email not displaying correctly? View it in your browser. Issue #472 December 08 2022 Editor's Picks

I liberate the ending to Minecraft from Microsoft and give it to you — and You don't need live chat on your website

Thursday, December 8, 2022

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

Airtable lays off 250+ as CEO cites importance of 'being a lean organization'

Thursday, December 8, 2022

TechCrunch Newsletter TechCrunch logo The Daily Crunch logo By Christine Hall Thursday, December 08, 2022 Hello, Happy Thursday. There is a lot of news today, much of it posting as I write this — for

💻 Issue 335 - .NET open source is 'heavily under-funded' says AWS

Thursday, December 8, 2022

This week's Awesome .NET Weekly Read this email on the Web The Awesome .NET Weekly Issue » 335 Release Date Dec 08, 2022 Your weekly report of the most popular .NET news, articles and projects

💎 Issue 342 - Find a mentor in the Ruby community

Thursday, December 8, 2022

This week's Awesome Ruby Newsletter Read this email on the Web The Awesome Ruby Newsletter Issue » 342 Release Date Dec 08, 2022 Your weekly report of the most popular Ruby news, articles and

💻 Issue 342 - Creating an upvote system with React and Socket.io 🥳 🔝

Thursday, December 8, 2022

This week's Awesome Node.js Weekly Read this email on the Web The Awesome Node.js Weekly Issue » 342 Release Date Dec 08, 2022 Your weekly report of the most popular Node.js news, articles and

💻 Issue 342 - Introducing Codux - The First Visual IDE for React

Thursday, December 8, 2022

This week's Awesome JavaScript Weekly Read this email on the Web The Awesome JavaScript Weekly Issue » 342 Release Date Dec 08, 2022 Your weekly report of the most popular JavaScript news, articles

📱 Issue 336 - Embedding Python interpreter inside a MacOS app (and iOS app), and publish to the App Store successfully.

Thursday, December 8, 2022

This week's Awesome iOS Weekly Read this email on the Web The Awesome iOS Weekly Issue » 336 Release Date Dec 08, 2022 Your weekly report of the most popular iOS news, articles and projects Popular

💻 Issue 260 - 5 Small and Hidden React libraries You Should Already Be Using

Thursday, December 8, 2022

This week's Awesome React Weekly Read this email on the Web The Awesome React Weekly Issue » 260 Release Date Dec 08, 2022 Your weekly report of the most popular React news, articles and projects