Clean Code in a Python Algorithm
The practice of writing clean code is one that exists no matter the language, framework or tool you use. When you write code that will be read or altered by any other developer, you will want that code to be easily readable and understandable, and easy to edit. Recently I've been working on some algorithms for an assignment at school, but I wanted to show off some of the things I might try to do to write clean code. The algorithm is in Python, which I have found can be easy to write cluttered code, but not difficult to write clean code either. I'll cover a couple of the things I chose to do to keep my code clean. The first thing I do here that is worth mentioning is the Python Typing library. It allows you to describe the types for a variable. It doesn't make your code immutable but it makes your code more readable. By specifying the type of data the function expects, a reader doesn't need to go searching through the code to understand what to give the function. Typing...