How to NOT write UGLY CODE ? | PEP-8 | Python Enhancement Proposals | VS-Code Plugins | autopep8 | Prettier | Preffered Settings
WRITE BEAUTIFULL CODE
LINK TO EXPLANATION :
Please feel free to watch the explanation.
If there is any Doubt and post it in the comment section.
The step by step guide will also be below :
WHAT IS PEP-8
Pep-8 is the most popular Python enhancement Proposal in which it has been clearly specified on how to follow some specific rules to make your code FORMAL, and more PRESENTABLE.
You can visit and read the exact proposal given on Python.org
(it is not preferred to read all the rules as the document i9s quite long and complex)
Some of the basic conventions are :
Method names should be all lower case
Words in a method name should be separated by an underscore
The non-public method should begin with a single underscore
If a method name needs to be mangled, two underscores may begin its name
How To Automate The Process @VSCode :
1> Go to plugins 
2>Search for autopep8
3>Install The plugin
4> Change the settings
OR
use SHIFT+ALT+F (Hotkey) to Format the Document Manually.
OR
Select VIEW -> COMMAND PALLET -> Search for "Format Document" and click on it.
CHANGE THE SETTINGS TO AUTOMATICALLY FORMAT CODE
(USE FORMAT ON SAVE FEATURE)
STEPS :
1> Go to FILE -> Preferences-> Settings
2> Search for "Format on save " option and CHECK THE CHECKBOX
3> To use the feature:
Save the code and the text will be automatically formatted according to pep8
OR
Ctrl + S (Hotkey)
Comments