官术网_书友最值得收藏!

Succinct and proper documentation

You should always try to write self-documenting code. This can be achieved through good programming style. Write code in such a manner that your classes, methods, and other objects are self-documenting. A new developer should be able to pick your code and not have to be stressed out before understanding what the code does and its internal structure.

Coding elements should be descriptive and meaningful to provide an insight to the reader. In situations where you have to document a method or class to provide further clarity, adopt the Keep It Simple Short (KISS) approach, briefly stating the reasons for a certain decision. Check the following code snippet; nobody wants to have to read two pages of documentation for a class containing 200 lines of code:

///
/// This class uses SHA1 algorithm for encryption with randomly generated salt for uniqueness
///
public class AESEncryptor
{
//Code goes here
}

KISS also known as Keep it Simple, Stupid, is a design principle that states that most systems work at their best when they are kept simple rather than making them unnecessarily complex. The principle aims at aiding programmers to keep the code simple as much as possible, to ensure that code can be easily maintained in the future.

主站蜘蛛池模板: 陈巴尔虎旗| 玛沁县| 尖扎县| 盖州市| 永胜县| 石楼县| 吴川市| 台南县| 安仁县| 娱乐| 南安市| 霍林郭勒市| 神木县| 石狮市| 绥中县| 巫山县| 莫力| 福鼎市| 双城市| 张北县| 邳州市| 扎兰屯市| 确山县| 江陵县| 江安县| 丘北县| 文昌市| 仁怀市| 黔东| 江华| 渭南市| 蓬莱市| 江西省| 若羌县| 民乐县| 濮阳县| 新昌县| 昆山市| 白朗县| 江油市| 东辽县|