Code standards and mathematical beauty book review

Google specification code
a: header file
header file should be self-sustaining (self-contained, i.e. as a first document is introduced into the head), to end .h. As for the text file into the final analysis, they are not the first document, it should end with .inc. Do not allow isolated -inl.h header file approach.
The DEFINE protection: all the header files should use #define to prevent multiple header file is included, when naming format is: H .
Inline functions: the function only when only 10 lines or less will be defined as inline functions advantages: as long as the body of the function inlining is small, inline function which can make access more efficient object code for the function and other short body functions, performance-critical functions, encourage the use of inline.
disadvantages: inline abuse will cause the program may become slower inline target code amount, or increase or decrease, depending on the size of the inline function . inline function is usually very short access reduces code size, but inlining a very large function can dramatically increase code size. modern processors due to better use of the instruction cache, smaller code usually execute faster.
Conclusion: A reasonable rule of thumb is to not inline the function of more than 10 lines of caution destructor, the destructor often looks much longer than its surface, because of the implied members and base class destructor. It is called!
II: function
all by the parameters passed by reference must be labeled const in the C language, if the function needs to modify the value of a variable parameter must be a pointer, such as int foo (int. PVAL) in C ++, the function can. declared as reference parameter: int foo (int & val) .
function overloading: to use the function overloading, you must allow the reader to see the point of call on the answers, but do not bother guessing call overloaded function in the end what kind of this rule also applies to the constructor function you can write a parameter of type const string &, and then use another parameter of type const char.
function overloading its
return type of the function syntax rear: only conventional writing ( returns the type of head) for writing or not the return type is inconvenient to use when reading the post grammar.
Three: formatting
each line of code does not exceed 80 characters.
Try not to use non-ASCII characters, it must use UTF-8 encoding.
Use only spaces, each indented two spaces.
The return type and function names on the same line, but also try to parameter on the same line, if it does not fit on parameter branch, branch manner consistent with the function call.
For more detailed specification of Google Code reference: http://zh-google-styleguide.readthedocs.org/en/latest/google-cpp-styleguide/
Ali's code specifications:
HTTPS : //blog.csdn.net/LuoJun_/article/details/77082966
Baidu code specifications:
https://blog.csdn.net/gb4215287/article/details/69940060

数学之美的读后感:

Dr. Wu book of architecture: the knowledge of the context of communication theory applied to natural language processing them. Compare languages ​​and digital information, and then use statistical knowledge, and gradually build the model. Dr. Wu learned from the Internet that Google China, Japan, South Korea search algorithm inventor, but the book did not like the general textbook knowledge as to speak so obscure, so that beginners feel foggy, but he said in a someone who has, home technology point of view to explain the past, natural language processing. Such knowledge will cross different disciplines integrate, such as communications, etc., we are more conducive to choose their own research, broaden the limited field of vision.

Guess you like

Origin www.cnblogs.com/orcking/p/11481960.html