Motivation

As a data scientist, it is essential to have good coding practices because it is easier for coworkers viewing your code and for you to avoid confusion when revisiting your code in the future. You want your code to be both clean and easy to understand.

Thus, it is essential to:

  • Include type hint
  • Write good documentation
  • Keep the relevant variables and functions and import relevant packages
  • Highlight the code that needs attention or improvements
  • Avoid other trivial mistakes such as forgetting to declare the variables

Instead of trying to pay attention to several small details in your code at once, why not using extensions to assist and remind you? This will help cultivate good coding practices.

VSCode is my favorite IDE because of its useful keyboard shortcuts and extensions. I wrote about my favorite keyboard shortcuts and how these top 4 code viewers in VSCode make it easier for me to review my data. In this article, I will introduce 4 of my favorite VSCode extensions for good coding practice.

Python Type Hint

Type hinting indicates the type of value within your Python code, making it easier for the people who use your functions or classes to know which datatype to insert for a specific parameter in your functions or classes.

For example, by adding type information to a function, it reminds those who use your code to insert an argument of type datetime.

#python #programming #data-science #coding #vscode

Incorporate the Best Practices for Python with These Top 4 VSCode Extensions
1.75 GEEK