What is the function of TODO in Pycharm?

Source: Internet
Author: User
Php Chinese network (www.php.cn) provides the most comprehensive basic tutorial on programming technology, introducing HTML, CSS, Javascript, Python, Java, Ruby, C, PHP, basic knowledge of MySQL and other programming languages. At the same time, this site also provides a large number of online instances, through which you can better learn programming... Reply content:
When working on a project, it's often needed to create a list of tasks for yourself or your team mates. While usually these tasks are described in an issue tracker like YouTrack , Some tasks are either too small or too code-specific to describe in an issue tracker. In such a case, adding TODO comments in source code makes sense.
Specifically, when you are writing code, you suddenly realize that your previous code has a potential small bug, but it is not important. the common practice is:
  • Fix the bug immediately. Then, when you return to your current job, your thinking will be interrupted.
  • Keep the bug in your mind and continue to write your code. soon you forget this bug.
  • Make a comment on the bug and continue writing the code. soon you forget this bug. a long time later, you will find a comment when you flip the previous code.
  • ......
The wise practice is:
Write "# Todo: computer will explode while running the program for 24 + hours"And continue to write the code.
To prevent you from forgetting this bug in the future, pycharm will prompt you in three places:

In addition, todo can also be used to differentiate between projects with multiple users. "Who is going to fix this bug". PyCharm official documentation Introduction:
Create several filters, which you will use to show the TODO items, say, for each of the developers, and not for your good self. for this purpose, in the Filters section, click, and specify the filter names, for example, For John, For Bob, and not for me. associate these filters with the patterns:

Now, in the source code, create TODO items: in the line of code, where you want to add a note, press Ctrl + Slash, or Ctrl + Shift + Slash, and type TODO that matches one of the patterns, followed by some meaningful description:
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.