How to write quality software with Python

If the code works that’s not enough.

Duncan Dayne
8 min readAug 12, 2019
Photo by David Clode on Unsplash

Python is an increasingly popular programing language and this is not by chance.

  • It’s one of the most readable programing languages today.
  • It has a huge collection of really useful libraries.
  • It’s easy to learn and easy to understand.
  • It’s designers placed less of an emphasis on conventional syntax, which makes it easier to work with, even for non-programmers or developers.

Python is widly used, which has a drawback, namely: many people write undemanding, uncommented and unmanageable codes that can appear anywhere on the internet. These undemmanding codes are horrible, they ignore even the most reasonable style “rules” of the language.

This article helps you to recognize them, deal with them, and prevents you from writing low-grade code with Python.

Note that this article mainly concentrates on the styling of the code itself and not on the actual algorithms.

What I mean by horrible Python code

Let’s take an example where I show what I mean on horrible code. See this solution for the widely known Fizz-Buzz problem:

# First solution
for i…

--

--

No responses yet