[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 Dependency Pitfalls] "Re-inventing the wheel" disease

Sunday, August 7, 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

[Sublime + Python Setup] The Ctrl+s "Heisenbug"

Saturday, August 6, 2022

"What the **** is going on?!" I heard Keith yell. Returning from my lunch break and in a helpful mood I grabbed my coffee mug and shuffled over to my coworker's desk. "What's

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

Saturday, August 6, 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 Dependency Pitfalls] Artisanal "from-scratch" development

Saturday, August 6, 2022

Hey there, The other day I got this question from Newsletter member Newvick in my email inbox: ~~~ I'm trying to get past the beginner's stage in Python and one problem I have is: When do you

[Sublime + Python Setup] How to become a happier & more productive Python dev

Friday, August 5, 2022

Hey there, I really struggled with setting up an effective development environment as a new Python developer. It was difficult to build the right habits and to find a set of tools I enjoyed to use.

You Might Also Like

A deal made in cloud security heaven

Thursday, April 18, 2024

Meta's Llama 3 goes public and hackers hold World-Check data for ransom View this email online in your browser By Christine Hall Thursday, April 18, 2024 Welcome to TechCrunch PM! I'm glad you

💎 Issue 413 - RubyJS-Vite

Thursday, April 18, 2024

This week's Awesome Ruby Newsletter Read this email on the Web The Awesome Ruby Newsletter Issue » 413 Release Date Apr 18, 2024 Your weekly report of the most popular Ruby news, articles and

💻 Issue 406 - Swift for C++ Practitioners, Part 1

Thursday, April 18, 2024

This week's Awesome .NET Weekly Read this email on the Web The Awesome .NET Weekly Issue » 406 Release Date Apr 18, 2024 Your weekly report of the most popular .NET news, articles and projects

💻 Issue 413 - How to implement HLS Video Streaming in a React App

Thursday, April 18, 2024

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

📱 Issue 407 - Textual Healing: iOS Text Editing Minutiae

Thursday, April 18, 2024

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

💻 Issue 413 - Interview with Senior JavaScript Developer 2024 [video]

Thursday, April 18, 2024

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

💻 Issue 331 - 30+ app ideas with complete source code

Thursday, April 18, 2024

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

💻 Issue 408 - Curl: Hyper, is it worth it?

Thursday, April 18, 2024

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

📱 Issue 410 - Swift for C++ Practitioners, Part 1

Thursday, April 18, 2024

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

🤷🏻‍♂️ What to Do When Windows Won't Boot — How to Try the Android 15 Beta

Thursday, April 18, 2024

Also: We Tried a Small AI Voice Recorder, and More! How-To Geek Logo April 18, 2024 📩 Get expert reviews, the hottest deals, how-to's, breaking news, and more delivered directly to your inbox by