You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- A skill is a set of instructions - packaged as a simple folder - that teaches Claude how to handle specific tasks or workflows. Skills are one of the most powerful ways to customize Claude for your specific needs.
Copy file name to clipboardExpand all lines: 编程技术.md
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -591,12 +591,63 @@ helper
591
591
592
592
# 代码质量
593
593
594
+
595
+
596
+
```markdown
597
+
Good code still has a cost #
598
+
好的代码仍然有成本 #
599
+
600
+
- Delivering new code has dropped in price to almost free... but delivering good code remains significantly more expensive than that.
601
+
- 交付新代码的成本已经降至几乎免费...但交付好的代码仍然比那贵得多。
602
+
603
+
Here's what I mean by "good code":
604
+
我所说的"好的代码"是指:
605
+
606
+
The code works. It does what it's meant to do, without bugs.
607
+
代码能正常工作。它能完成预期的功能,没有 bug。
608
+
We know the code works. We've taken steps to confirm to ourselves and to others that the code is fit for purpose.
609
+
我们知道代码是有效的。我们已经采取措施向自己和他人确认代码符合用途。
610
+
It solves the right problem.
611
+
它解决了正确的问题。
612
+
It handles error cases gracefully and predictably: it doesn't just consider the happy path. Errors should provide enough information to help future maintainers understand what went wrong.
It’s simple and minimal - it does only what’s needed, in a way that both humans and machines can understand now and maintain in the future.
615
+
它简洁且精简——它只做所需之事,以一种人类和机器现在都能理解并在未来可以维护的方式。
616
+
It's protected by tests. The tests show that it works now and act as a regression suite to avoid it quietly breaking in the future.
617
+
它受到测试的保护。测试表明它现在可以正常工作,并作为回归测试套件,以避免它在未来悄无声息地失效。
618
+
It's documented at an appropriate level, and that documentation reflects the current state of the system - if the code changes an existing behavior the existing documentation needs to be updated to match.
The design affords future changes. It's important to maintain YAGNI - code with added complexity to anticipate future changes that may never come is often bad code - but it's also important not to write code that makes future changes much harder than they should be.
All of the other relevant "ilities" - accessibility, testability, reliability, security, maintainability, observability, scalability, usability - the non-functional quality measures that are appropriate for the particular class of software being developed.
Coding agent tools can help with most of this, but there is still a substantial burden on the developer driving those tools to ensure that the produced code is good code for the subset of good that's needed for the current project.
The challenge is to develop new personal and organizational habits that respond to the affordances and opportunities of agentic engineering.
630
+
挑战在于培养新的个人和组织习惯,以应对代理工程提供的便利和机会。
631
+
632
+
These best practices are still being figured out across our industry. I'm still figuring them out myself.
633
+
这些最佳实践仍在整个行业中被探索。我自己仍在探索它们。
634
+
635
+
For now I think the best we can do is to second guess ourselves: any time our instinct says "don't build that, it's not worth the time" fire off a prompt anyway, in an asynchronous agent session where the worst that can happen is you check ten minutes later and find that it wasn't worth the tokens.
0 commit comments