It refers to the place where bugs may occur when writing code to a new project. It accumulates and avoids bugs.

Source: Internet
Author: User

It refers to the place where bugs may occur when writing code to a new project. It accumulates and avoids bugs.

(1) when using the control, it is easy to forget findview after declaring the variable.

In this way, when the program runs, a null pointer will be reported. Sometimes the business logic in the project may be complicated. If the test is not a crazy test, some logics will not be accessible, some settings in the project's launch background will let the program go to a code segment that may report null pointers. Silly!

(2) Various numerical conversion processes, such as converting a string to an integer, can easily throw an exception.

It is best to take necessary preventive measures, such as adding a try statement or some early judgment statements. If the background developers do not strictly control the data input, then wrong data will crash your application. In short, do not trust users because they are not developers.

(3) initialization controls and initialization of some data in wrong order

We may often write projects that like to divide the initialization control and the initialization data for the control into two function writes, so pay attention to the execution sequence of the two functions. Don't be so careless. This will also hide bugs in (1.

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.