-
Notifications
You must be signed in to change notification settings - Fork 8
02. General coding style
Alex Parry edited this page Jan 23, 2023
·
1 revision
Don’t do this | Do this | |
---|---|---|
Compound statement | amount = int(input("Enter the amount")) |
response = input("Enter the amount") amount = int(response)
|
Compound statement | print(get_total(n1, n2)) |
total = get_total(n1, n2) print(total)
|
Begin function and method names with a verb except where they are implementing a standard algorithm (in which case use the algorithm name).
For example, calculate_pay
or validate_input
(case depends on language used) or linear_search
.
Begin class, structure, module, and property names with a noun.
For example, EmployeeName
(case depends on language used)