纸聊

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 92|回复: 0

Empathetic code is code without complicated

[复制链接]

1

主题

0

回帖

5

积分

新手上路

Rank: 1

积分
5
Rubina9898 发表于 2023-12-21 16:24:50
Whenever I think about skipping a simple fix or adding small improvements I remember one of the classics of Polish YouTube . If you leave an error in the code that you are aware of leave a comment information whatever. It may be the TODO mentioned above but with context a description of the problem and a link to the ticket in the issue tracker. It can even be a test marked as skippedor an empty test suite.

Anything that indicates that problems may be expected at a particular point in the code is better than nothing. However I do not encourage you to create code of a quality Phone Number List worthy of Mr. Wieś from Blok Ekipa . Consciously incurring technical debt is OK but patting the code along the path of least resistance is not. So what is the empathetic code Here you could also answer briefly the empathetic code is a code that does not fit the description from the earlier part of this article. When writing empathetic code it is worth starting with the obvious.




Clear names of variables functions and classes.dependencies consistent with good practices such as the already mentioned SOLID KISS and DRY. Such code can also use design patterns but in a reasonable and responsible way. Empathy in programming also means consistency using a uniform style conventions and solutions in the code. Empathetic code is tested code. However the mere existence of tests is not enough. Tests should be stable fast easy to expand and maintain and actually test a given piece of code . Test not only main paths but also edge cases possible errors and other cases that deserve to be tested.

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|小黑屋|纸聊

GMT+8, 2025-5-12 07:00 , Processed in 0.055444 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表