Notes on Litter note

To comply with the principles of programming high cohesion and low coupling

The function code function body should not exceed 30 lines

Generally have a line space before return

When the variable assigned to the variable name to both ends of the equal sign equal sign

 

Many large companies in general, every Friday, when will conduct a review of the code, optimized code checks, and some share exchange

Large companies generally to the code format specification requirements are particularly strict

Functions like variable naming style:

Large hump body def GetUserInfo capitalize the first letter of each word in all lowercase letters other

The only difference is that the first word of the small and large hump hump body def getUserInfo body first letter lowercase

Underline def get_user_info connect all the information underlined words

And these three ways of life style is best not to mix, but I just use the underscore after connection

SQL statement is best not to have nested nested query efficiency will be relatively low, then

To accelerate the lookup table plus the indexes

MYSQL, the type of the index are:

Primary key index: accelerate Find + + can not be null primary key can not be duplicated

The only Find: Find + acceleration can not be repeated unique (name)

United unique index: Accelerated Find + two can not be repeated at the same time

Ordinary Index: Accelerated Find index ix_name (name)

Composite index: Accelerated Find index ix_name_email (name, email)

Guess you like

Origin www.cnblogs.com/1832921tongjieducn/p/11074972.html