Dan Bader

5 Python Development Setup Tips to Boost Your Productivity

I 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.

Back then I didn’t understand how much this impacted my productivity. I didn’t even know some of the most valuable practices and tools I’m using today existed!

As my experience grew I understood this was a common pain among Python developers. No matter who I spoke with—colleagues, strangers at a conference, or developers on web forums and mailing lists—I saw similar struggles.

Today I believe entry-level Python programmers can make leaps in their productivity by adopting a few key practices and tools into their workflow.

This article helps you identify and fix 5 common issues in your Python development setup. I experienced them all myself and in some cases helped others through them as a colleague and a team lead. If you can avoid these issues you’ll become a happier and more effective Python developer.

#1 – Don’t waste time doing the compiler’s job

When developer brains do what computer brains can do much better then that’s usually a costly mistake. One example is programmers spending time hunting bugs that could be spotted just as well by automated tools.

For some reason, maybe because of Python’s dynamic nature and earlier status as a “scripting” language, it’s still rare to see it used with static code analysis tools and linters.

But these tools are fantastic. They can help detect and avoid certain bugs and classes of errors completely. For example, they can catch functional bugs like misspelled identifiers or reveal code quality issues like unused variables and imports.

I won’t say code analysis tools are a miracle cure—but they can help reduce debugging and code review time with a small initial time investment.

If you’re looking for just one tool that will improve the quality of your Python code without getting in the way with false positives and verbose messages, then I’d recommend the Pyflakes code linter. Pyflakes is open-source, available for free, and easy to set up.

To get immediate feedback and catch bugs early I recommend you integrate Pyflakes with your code editor and build server. Automatic linting for code changes as part of your continuous integration process makes your life easier. It ensures all developers on your team use the same settings and no uncaught warnings slip through the cracks.

Tip 1: Use static code analysis tools like Pyflakes.

#2 – Avoid fruitless code style discussions

Your team does code reviews? Great! But be aware that a common mistake among inexperienced code reviewers is to spend too much time on feedback that automated tools could give for them. I’m talking about code style issues.

It’s easy for development teams to get into a habit where they mostly talk about code style issues in code reviews: “We need an extra space character here.” or “Class names should use camel case.”

This is a form of bikeshedding that prevents developers from looking at the real issues. The ones that cost money and cause maintenance problems later on.

A quick fix here is to pick one of the Python style guides available on the internet, like PEP 8 or Google’s Python Style Guide, and to put automated tools in place that make sure committed code follows the style guide.

I recommend using PEP 8 as a style guide in combination with the Pycodestyle or flake8 code style checker. This will help avoid most code style discussions and allows your team to focus on the issues that matter.

Tip 2: Pick a code style (PEP 8) and enforce it with automated tools.

#3 – Micro delays and death by a thousand cuts

Usability research shows the large effect website page load time has on user abandonment: If people get bored waiting for something to happen it increases the chances that they’ll abandon the original task they had in mind.

As software developers, waiting on tools to complete their job is a normal part of our day to day workflow. We’re always waiting for a module to install, a test to run, or a commit to finish (“It’s compiling!”). Of course we’re not “abandoning” our work every time we have to wait a few seconds for a tool to run—keeping focused on the task at hand is part of our job after all.

Yet, keeping that focus costs mental energy that we might then lack in other areas of our work: We get tired a little quicker in the afternoon, or introduce a tiny little extra bug with our latest commit.

In my experience even small forced pauses and delays add up. Switching files in a slow editor or jumping between apps on a slow computer is frustrating! We can even apply this at a microscopic level and look into editor typing latencies. I believe these micro delays add up, too. They cost us productivity and cause frustration.

Got time for a little thought experiment? Let’s say you’re waiting for a task to complete for about 1 out of every 10 seconds you spend on productive work. That adds up to half a day per week, or 2 days a month, or a whole month of productive work you might be losing over the course of a year.

Maybe this estimate is too high—but what if you could get an additional week of productive time a year just by spending an afternoon on optimizing your tools? I’d say that’s worth a try!

Tip 3: Your development tools should be fast. Favor simplicity.

#4 – Don’t work with an unpleasant editing environment

Working with tools that I don’t enjoy crushes my productivity. You might know the feeling. Some tools are so frustrating to work with they zap your energy levels and motivation.

What’s the most important tool that you work with every day as a developer? For me it’s my code editor. For some developers it might be their email client or a team chat app—but let’s hope that a large part of your day is spent writing code.

This means it pays off in terms of productivity (and happiness!) to invest into an enjoyable code editing environment.

As Python developers we have many editors and IDEs to choose from: Vim, Emacs, PyCharm, Wing IDE, Atom, Eclipse PyDev, Sublime Text—just to name a few.

I spent much time fine-tuning my editing environment over the years. After trying other editors and IDEs I eventually settled on Sublime Text. I like its speed, simplicity, and stability. It just feels right for my programming workflow. And I arrived at this choice by trying as many other options as I could.

Your choice might be different. The point I’m trying to make is you need to find out which tool works best for yourself and your unique needs. Go and try out some editors and see which one you enjoy the most. Your productivity will thank you for it.

Tip 4: Find the right editor and tailor it to your needs.

#5 – Invest in your setup

I once worked with someone who used a commercial editor to write code. But that developer didn’t want to spend the money to purchase a license for it. Instead they used the trial version of the editor for months on end.

The trial version of this particular editor has a nag screen that pops up every few minutes when you save a file, asking you to buy the full version. This developer constantly saved files out of habit and therefore got to see that nag screen hundreds of times a day…

A license that would’ve removed the nag screen cost about $70. I love a frugal mindset but this was ridiculous! Trying to save some money on a critical tool you use all day was the wrong choice—I’m sure the nag screens and the subtle frustrations they caused added up to more than $70 of lost productivity.

If you’re working for yourself then these license costs will be a business expense you can deduct from your taxes. If you’re working for a company I’m sure they’ll gladly invest in your tools if you explain how they make you more productive and more valuable as an employee.

License costs for software development tools are low compared to what graphic designers or architects have to put up with, for example. Some of the best tools and editors are even available for free. Invest money in the right tools where it makes sense and your life (and career) will be better for it.

Tip 5: Invest in tools that make you happy and more effective.

Where to start?

I showed you five common development setup issues that can harm your productivity as a Python programmer. Luckily most of them are easy to fix with the right approach:

  • Tip 1: Use static code analysis tools like Pyflakes.
  • Tip 2: Pick a code style (PEP 8) and enforce it with automated tools.
  • Tip 3: Your development tools should be fast. Favor simplicity.
  • Tip 4: Find the right editor and tailor it to your needs.
  • Tip 5: Invest in tools that make you happy and more effective.

Here’s a good way to start: Find the one problem that irritates you the most. You’ll want to divide and conquer instead of trying to achieve perfection immediately. Fix one small thing at a time. Then iterate and keep making improvements from there.

Think of it as an investment—even small changes will compound over time and give you a nice long-term productivity gain. In my experience, success is all about building the right habits and a mindset of continuous improvement.

A great development environment makes you feel confident and productive. When you feel right at home in your setup programming Python becomes even more enjoyable and fun. Good luck!

(This article was originally published on TechBeacon.)

Improve Your Python with a fresh 🐍 Python Trick 💌 every couple of days

🔒 No spam ever. Unsubscribe any time.

This article was filed under: productivity, and python.

Related Articles:
Latest Articles: ← Browse All Articles