Code clean way study notes 1

The first rule of a function: short.

2 function should do only one thing. Do it well. Only this one thing.

3 Each function an abstract level. The method of using the internal function abstraction layer should be the same.

4 long and descriptive name than the name short and puzzling good. Long and has a long comment descriptive name descriptive than good.

5 If you want to convert the input parameters, the results should be reflected in the return value.

6 to function a good name, as well as the intention of the order parameter can better explain the function.

7

Guess you like

Origin www.cnblogs.com/zhaopengcheng/p/11580274.html