Code Formatting
Learn about important code quality traits and how to best utilize a coding style guide.
Is clean code only about formatting and structuring the code? The short answer is no.
There are some coding standards like PEP-8 that state how the code should be written and formatted. In Python, PEP-8 is the most well-known standard, and it provides guidelines on how we should write our programs, in terms of the spacing, naming conventions, line lengths, and more.
However, clean code is something else that goes far beyond coding standards, formatting, linting tools, and other checks regarding the layout of the code. Clean code is about achieving quality software and building a system that is robust and maintainable. A piece of code or an entire software component can be 100% compliant with PEP-8 (or any other guideline) and still not satisfy these requirements.
Even though formatting is not our main goal, not paying attention to the code structure has some perils. For this reason, first we'll analyze the problems with a bad code structure and how to address them. After that, we'll see how to configure and use tools for Python projects to automatically check the most common problems.
Get hands-on with 1400+ tech skills courses.