[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, July 3, 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, July 2, 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, July 1, 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, June 30, 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

Thursday, June 30, 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

wpMail.me issue#576

Thursday, August 18, 2022

wpMail.me wpMail.me issue#576 - The weekly WordPress newsletter. No spam, no nonsense. - August 18, 2022 Is this email not displaying correctly? View it in your browser. News & Articles Rethinking

Airbnb tests anti-party tech

Thursday, August 18, 2022

The Morning After Now available on your smart speaker and wherever you get your podcasts Apple Podcasts | Spotify | Google Play | iHeart Radio It's Thursday, August 18, 2022. Airbnb, which

Do Samsung Galaxy Watches Work With Non-Samsung Phones?

Thursday, August 18, 2022

Read in Browser Logo for Review Geek August 18, 2022 Few smartwatches match the quality of Samsung's Galaxy Watch lineup. But if you don't own a Samsung smartphone, is a Galaxy Watch actually

Post from Syncfusion Blogs on 08/18/2022

Thursday, August 18, 2022

New blogs from Syncfusion A Full-Stack Web App Using Blazor WebAssembly and GraphQL: Part 6 Design a Car Dashboard Like a Pro Using the WinUI Radial Gauge More from the Syncfusion Ecosystem Bold

🗣🤖 Edge#218: Meta AI's BlenderBot 3, A 175B Parameter Model that can Chat About Every Topic and Organically Impr…

Thursday, August 18, 2022

The new release represents a major improvement compared to previous versions ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

iPhone 14 event 📱, Amazon's TikTok-style feed 🛍️, Reddit Developer Portal 👨‍💻

Thursday, August 18, 2022

This year's iPhone event will be held on September 7. Sign Up | View Online | Sponsor Daily Update 2022-08-18 Skyflow compared 4 approaches to data privacy. Here are the conclusions (Sponsor)

[Python Mastery] Learn Python in 21 days!!!!11 (what a lie)

Thursday, August 18, 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 Dependency Pitfalls] How to set the world on fire

Thursday, August 18, 2022

Hey there, #1 on my list of dependency management pitfalls is there for a good reason: It lead to a single developer causing mayhem and breaking thousands of open-source projects around the world in

Laravel + WordPress, Silver Play Button and More

Thursday, August 18, 2022

Hey hey, So today is an important day for me, as I have unboxed my Youtube Silver Play button for 100000 subscribers, still can't believe it. Meanwhile, business as usual, will still keep putting

Migrate your Elasticsearch data across clusters with zero downtime

Thursday, August 18, 2022

Deep dive on migrating data effectively using CCS and CCR elastic | Search. Observe. Protect Cloud migration workflow using CCS and CCR Register now Date & Time September 8, 2022 1:30 pm SGT, 3:30