Code cleansing symptoms

Source: Internet
Author: User

In either of the following situations, you haveCodeJie Li. The severity of the symptoms can be mild to severe, and the minor helps to write elegant and clean code. The severe ones will not be defeated.

  1. Extra empty rows, semicolons, and unused variables. For more information, see delete one.
  2. Tabs or spaces that are not aligned must be corrected. Apart from indentation, two consecutive spaces in the Code cannot be seen.
  3. You can see that a method of a class is not annotated and can't help adding it, no matter whether it makes sense or not.
  4. The spelling of the mistake must be corrected in terms of naming or comments; the case of inconsistency must be corrected; the omission of punctuation must be supplemented.
  5. The Code such as if (a = 0) must be changed to the form of IF (0 =.
  6. All ide code alarms must be cleared, regardless of whether the method is practical or not.
  7. When you see naked numbers, they must be defined as constants. Even if the numbers are intuitively understood, they can only accept constant numbers.
  8. See non-static public variables. The get/set method must be created.
  9. The shortcut keys that are constantly organized by code format are Ctrl + Shift + F, CTRL + Shift + O in eclipse, and even Ctrl + S.
  10. Once you see more than three consecutive if-else judgment branches, optimization is required; similar method call code, if it appears consecutively, optimization is required; methods that exceed several rows must be restructured.
  11. The most essential performance is that you like to read your code for a long time. You are excited and self-satisfied.

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.