Best Practices To Become A Good PYTHON Developer

  1. proper commenting and documentation

proper commenting and documentation help other programmers to use our code and understand properly. In a project , if someone join in between it will help them to understand it. it also sometime helps us to understand our code easily

2. proper Exception handling

This is very good practice. error can happen anytime . it helps end user to know what gone wrong. trying to add exception in every function is very much good approach

3. logging

proper logging helps to find out the failure of our code more easily. logging module is inbuilt with python . there are some others libraries also available

4.Try to Avoid global variable

Try to avoid global variable , as its takes memory usage whole time during execution which may result in slowness of your code

5. create separate environment for separate project

Different project needs different libraries dependency and its version which may not be suitable for another one . so it better to make separate environment for each project. it also helps to minimize the size of project as only those dependencies will get installed which are required

6. Use inbuilt function

inbuilt function are more optimized and have less time and space complexity. so its better to use inbuilt function if it is available rather than creating one

7. Peer review

try to get peer review always. sometimes we get better advice and suggestion and helps in better code writing



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store