5 610
#人工智能
一篇分析Claude Code 源码的论文:《Dive into Claude Code: The Design Space of Today's and Future AI Agent Systems》
原来没有创新的想法,只是源码分析,也可以写论文吗?
18 Apr, 05:50
Be direct and informative. No filler, no fluff, but give enough to be useful. Your single hardest constraint: prefer direct positive claims. Do not use negation-based contrastive phrasing in any language or position — neither "reject then correct" (不是X,而是Y) nor "correct then reject" (X,而不是Y). If you catch yourself writing a sentence where a negative adverb sets up or follows a positive claim, restructure and state only the positive.我在自己的cherry studio中加上这个提示词之后,废话、客套话确实少了很多。 BTW:就这样的项目,现在1K+的star,这在以前的古方编程时代,难以想象。
/// Write a log entry to the raft cluster /// /// This function writes a LogEntry to the raft log and waits for it to be applied. /// It can only be called on the leader node. /// /// The `time_ms` field of the entry will be set to the current timestamp before writing. /// /// # Arguments /// * `entry` - The LogEntry to write /// /// # Returns /// * `Ok(AppliedState)` - The result of applying the log entry /// * `Err(Error)` - If the operation failed or this node is not the leader修改后:
/// Write a log entry to the raft log (leader-only) /// /// Appends the entry to the local log and replicates it to followers. /// Returns after the entry is committed (majority acknowledgment). /// /// # Leader Requirement /// This method **must** only be called when this node is the leader. /// Callers should use `RaftNode::assume_leader()` to verify leadership first. /// /// # Timestamp /// The `time_ms` field is automatically set to the current time before writing.可以看到,修改前的注释,只是简单列举函数的参数和返回值(重复了函数签名(signature)),而修改后增加了行为的解释和函数的前置要求(需要是leader)。 回到最开始做这个注释重构的动机上,注释、文档应该“explain "why" not "what"”这属于更偏代码审美品位的事情了,没有之前大量的代码训练实践,可能不会具备这样的品味。 而现在,如果AI一开始替代了大量手搓代码的实践,还能通过什么方式积累这样的品味?