Previous
Python Rules Of Coding: Indentation
Python Rules Of Coding
Naming Conventions :
There are a lot of different Python naming conventions. It is recommended to apply these rules or conventions to our code. If we want to ensure our code's better quality, readability, and reusability. Applying name guidelines we can improve the performance and robustness of our Python Applications.
The rules or conventions :
- Always use a meaningful name.
- lowercase or lower_case_with_underscores. Ex. kalil, user_info
- Avoid too simple name like 'X', 'x', 'Y'
- The name of package, module in Python always should be lower case and short, if needs use an underscore as a separator to join multiple words and it should be a meaningful or logical name. Ex. csspec or css_spec
- Class names in Python follow the CapWords convention. We can also name a class like a function if the class is callable.
- The naming of the global variable, functions, and methods should follow the lowercase naming convention.
- Use 'self' as the first argument for an instance method and 'cls' as the first argument for class methods.
- Constants' names in Python always follow the UPPERCASE convention. We can use underscore(_) for joining multiple words.
I used to study since python is the most flexible programming language.
Python is quite flexible indeed (in terms of applications).
Nice insight on python rule of coding. This is the kind of content we support on gitplait. You can post via the community for others to learn, and you can as well learn through other contents that involves development. There is more to gitplait. https://gitplait.tech
https://hive.blog/trending/hive-103590. Would be glad to have you around. You can also join the discord server https://discord.gg/mD8ez2.