PB variable naming

Source: Internet
Author: User
Tags integer lowercase naming convention variable scope

Author: Xingda Computer technology company (www.study01job.com) Guo Baoli

Variable names should be in accordance with the naming convention, for use frequent or key variables, for readability and modification, the definition should be annotated with its meaning. For example:

String ls_name//Name of the insured person

Variable naming rules are: Variable type + data type + ' _ ' + meaning code

Example:

String instance variable: Is_ variable name;

Date-Type global variable: gd_ variable name;

General variables, with lowercase letters;

Global variable, capitalizing the entire variable name;

Variables: Both are declared in lowercase letters.

Variable Type conventions

The variable type convention is shown in table 1-9.

Variable scope naming convention

The contents of table 20-10 are described below.

A. The naming of global variables must conform to the Gt_subsystemname_detailname format where G is represented as a global variable (Globe), T is a shorthand for data type (DataType): I represents an integer (int), l represents a long integer (length), C Represents a character type (char), and S is a string type (string). Subsystename is an English shorthand for subsystems. Detailname is an English letter with specific meaning. For example: Gs_query_user_info, which defines a string-type global variable for the query subsystem.

B. The naming of local variables must conform to the Lt_detailname format, where L represents a local variable (locally), and T is a shorthand for the data type (DataType): I represents an integer (int), l represents a long integer (a), and C represents a character type (char). s represents a string type. For example: Li_user_salary, which defines an integer local variable.

C. The naming of instance variables must conform to the It_detailname format where I represents an instance variable (Instance), and T is a shorthand for the data type (DataType): I represents an integer (int), l represents a long integer, and C represents a character type (char). s represents a string type. Detailname is an English letter with specific meaning. For example: Is_product_name, a string instance variable is defined.

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.