30/09/2018, 20:42

các quy tắc đặt tên biến và hàm

Các quy tắc đặt tên biến (được viết bởi aptech)

  1. Variable names must begin with an alphabet.
    2.The first character may be followed by a sequence of letters or digits and can also include a special character like the ‘underscore‘.
    3.Avoid using the letter O in places where it can be confused with the number 0 and similarly the lowercase letter L can be mistaken for the number 1.
    4.Proper names should be avoided while naming variables. Typically, uppercase and lowercase letters are treated as different i.e. variables ADD, add and Add are all different.
    5.As case-sensitivity considerations vary with programming languages it is advisable to maintain a standard way of naming variables.
    6.A variable name should be meaningful and descriptive; it should describe the kind of data it holds. For example, if the sum of two numbers is to be found, the variable storing the result may be called sum. Naming it s or ab12 is not a good idea
    Mem nào có them quy tăc nào thì bổ sung nha
Người bí ẩn viết 22:54 ngày 30/09/2018

Cảm ơn đãa share. Mmà hình như cái này anh @ltd có làm clip rồi

Bài liên quan
0