- C# and .NET Core Test Driven Development
- Ayobami Adewole
- 214字
- 2021-06-25 22:00:28
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.
- 從零開始:數字圖像處理的編程基礎與應用
- 潮流:UI設計必修課
- Mastering Adobe Captivate 2017(Fourth Edition)
- 摩登創客:與智能手機和平板電腦共舞
- 精通軟件性能測試與LoadRunner實戰(第2版)
- SQL Server 2016數據庫應用與開發
- Oracle從入門到精通(第5版)
- Kubernetes進階實戰
- Instant Automapper
- DB2SQL性能調優秘笈
- CryENGINE Game Programming with C++,C#,and Lua
- C/C++代碼調試的藝術
- Python機器學習
- 歐姆龍PLC編程指令與梯形圖快速入門
- 深度學習的數學:使用Python語言