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

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.

主站蜘蛛池模板: 沙湾县| 彩票| 滦平县| 聂拉木县| 张家口市| 厦门市| 社会| 盱眙县| 九江县| 闽侯县| 聂拉木县| 阿克陶县| 彭水| 晋宁县| 定日县| 那曲县| 西安市| 阿瓦提县| 云林县| 苍溪县| 循化| 长垣县| 临沭县| 新津县| 大理市| 中江县| 安徽省| 游戏| 衡东县| 滦平县| 琼海市| 调兵山市| 奉新县| 昌江| 多伦县| 清涧县| 辉南县| 德保县| 澜沧| 宜昌市| 鄂托克前旗|