[Python Mastery] What Pythonistas can learn from bestselling authors

Hey Reader,

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

[🐍PyTricks]: Try running "import this" inside a Python REPL ...

Thursday, April 16, 2020

>>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is

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

Wednesday, April 15, 2020

Hey Reader, 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"?

Tuesday, April 14, 2020

Hey Reader, 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

Finally, a reason to attend morning stand-ups again

Tuesday, April 14, 2020

Hey Reader, Do you love working with Python? I do! A smart human once said "the language you speak affects what you can think" And to be honest with you, I'd rather speak & think

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

Monday, April 13, 2020

Hey Reader, 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

You Might Also Like

New Glutton Malware Exploits Popular PHP Frameworks Like Laravel and ThinkPHP

Thursday, December 19, 2024

THN Daily Updates Newsletter cover Python Data Cleaning and Preparation Best Practices ($35.99 Value) FREE for a Limited Time Professionals face several challenges in effectively leveraging data in

Post from Syncfusion Blogs on 12/16/2024

Thursday, December 19, 2024

New blogs from Syncfusion Webpack vs Vite: Which Bundler is Right for You? By Kavindu Gunathilake Webpack vs. Vite: Explore the pros, cons & performance differences of these popular bundlers.

⚙️ Microsoft, Meta and new AI models

Thursday, December 19, 2024

Plus: UK considers copyright changes ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

📽 Webinar: How To Maximize Model Accuracy

Thursday, December 19, 2024

Struggling to keep your production ML models accurate without an endless budget? ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

On getting the meaningful discussions, and why that's important

Thursday, December 19, 2024

To put our design into practice, we need to be able to persuade our colleagues, stakeholders, and other peers. Without the ability to explain and persuade, even the best design will not be applied. And

⚡ THN Weekly Recap: Top Cybersecurity Threats, Tools and Tips

Thursday, December 19, 2024

Your one-stop-source for last week's top cybersecurity headlines. The Hacker News Top Cybersecurity Threats, Tools and Tips This past week has been packed with unsettling developments in the world

The most popular AI tools of 2024

Thursday, December 19, 2024

Windows 11 confusion; AI and baseball; Stream playoffs -- ZDNET ZDNET Tech Today - US December 16, 2024 ai-popularity-001 The most popular AI tools of 2024 (and what that even means) Want to know which

Dispatch 031: YouTube TV Makes a Costly Mistake...

Thursday, December 19, 2024

More: The Clock Keeps TikToking... • Kraven the Hunter Bombs • OpenAI Puts Elon Musk On Blast • The Threat of Elon • Meta Suddenly Cares About Non-Profit Structures • Apple Feels Out Folding Options

Understanding the Twitter API So You Can Design Your Own

Thursday, December 19, 2024

Top Tech Content sent at Noon! Boost Your Article on HackerNoon for $159.99! Read this email in your browser How are you, @newsletterest1? 🪐 What's happening in tech today, December 16, 2024? The

The villain in this game is the absence of AI

Thursday, December 19, 2024

How to fight an invisible enemy in a game you never asked to play ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏