pragmatic-programmer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseThe Pragmatic Programmer Reference
《程序员修炼之道》参考手册
A comprehensive reference for pragmatic software development principles based on "The Pragmatic Programmer" by David Thomas and Andrew Hunt. This skill provides timeless advice for becoming a better developer.
这是基于David Thomas和Andrew Hunt所著《程序员修炼之道》的务实软件开发原则综合参考手册。本技能为成为更优秀的开发者提供永不过时的建议。
When This Skill Activates
本技能的激活场景
This skill automatically activates when you:
- Discuss software development best practices
- Need debugging strategies
- Consider code duplication (DRY)
- Think about tooling and automation
- Discuss project estimation or planning
- Review development workflows
当你进行以下操作时,本技能会自动激活:
- 讨论软件开发最佳实践
- 需要调试策略
- 考虑代码重复(DRY)问题
- 思考工具与自动化相关内容
- 讨论项目估算或规划
- 评审开发工作流
Core Philosophy
核心理念
"Care about your craft." "Think about your work."
Pragmatic programmers:
- Take responsibility for their career and work
- Don't make excuses—provide options
- Are agents of change, not victims of circumstance
- Continuously learn and adapt
"重视你的技艺。" "思考你的工作。"
务实的程序员:
- 为自己的职业和工作负责
- 不找借口,而是提供解决方案
- 是变革的推动者,而非环境的受害者
- 持续学习与适应
Quick Reference
快速参考
Foundational Principles
基础原则
| Principle | Summary |
|---|---|
| DRY - Don't Repeat Yourself | Every piece of knowledge has a single representation |
| Orthogonality | Keep things independent and decoupled |
| Reversibility | Make decisions reversible; avoid lock-in |
| Tracer Bullets | Get feedback fast with end-to-end skeleton |
| Prototypes | Learn before committing; throw away prototypes |
| Domain Languages | Program close to the problem domain |
| Estimating | Learn to give accurate estimates |
| 原则 | 摘要 |
|---|---|
| DRY - Don't Repeat Yourself | 每一项知识都有唯一的表示形式 |
| Orthogonality | 保持事物独立且解耦 |
| Reversibility | 让决策具备可逆性;避免锁定 |
| Tracer Bullets | 通过端到端骨架快速获取反馈 |
| Prototypes | 先学习再投入;原型可丢弃 |
| Domain Languages | 贴近问题域进行编程 |
| Estimating | 学会给出准确的估算 |
Practical Techniques
实用技巧
| Practice | Summary |
|---|---|
| The Power of Plain Text | Keep knowledge in accessible format |
| Shell Games | Master the command line |
| Debugging | Fix the problem, not the blame |
| Text Manipulation | Learn text processing tools |
| Code Generators | Write code that writes code |
| Design by Contract | Define rights and responsibilities |
| Assertive Programming | If it can't happen, use assertions |
| Decoupling | Minimize dependencies between modules |
| Refactoring | Improve code continuously |
| Testing | Test early, test often, test automatically |
| Automation | Don't use manual procedures |
| 实践 | 摘要 |
|---|---|
| The Power of Plain Text | 以易访问的格式存储知识 |
| Shell Games | 精通命令行 |
| Debugging | 解决问题,而非归咎于人 |
| Text Manipulation | 学习文本处理工具 |
| Code Generators | 编写能生成代码的代码 |
| Design by Contract | 定义权利与责任 |
| Assertive Programming | 对于不可能发生的情况,使用断言 |
| Decoupling | 最小化模块间的依赖 |
| Refactoring | 持续改进代码 |
| Testing | 尽早测试、经常测试、自动化测试 |
| Automation | 拒绝手动流程 |
The Pragmatic Tips
务实小贴士
Key tips from the book:
- Care About Your Craft - Why spend your life developing software unless you care?
- Think! About Your Work - Turn off autopilot and take control
- Provide Options, Don't Make Excuses - Don't say it can't be done; explain what can be done
- Don't Live with Broken Windows - Fix bad designs and wrong decisions when you see them
- Be a Catalyst for Change - Show people the future and help them participate
- Remember the Big Picture - Don't get so focused you forget what you're doing
- Make Quality a Requirements Issue - Get users involved in determining quality
- Invest Regularly in Your Knowledge Portfolio - Make learning a habit
- Critically Analyze What You Read and Hear - Don't be swayed by vendors or media hype
- It's Both What You Say and How You Say It - Communication matters
书中的关键小贴士:
- 重视你的技艺 - 除非你热爱这份工作,否则为何要一生投入软件开发?
- 思考你的工作 - 关闭自动驾驶模式,掌控自己的工作
- 提供解决方案,而非找借口 - 不说“做不到”,而是说明“能做什么”
- 不要容忍破窗 - 一旦发现不良设计或错误决策,立即修复
- 成为变革的催化剂 - 向人们展示未来,并帮助他们参与其中
- 牢记全局 - 不要过于专注细节而忘记初衷
- 将质量作为需求问题 - 让用户参与质量标准的制定
- 定期投资你的知识组合 - 让学习成为习惯
- 批判性地分析你阅读和听到的内容 - 不要被厂商或媒体炒作左右
- 内容与表达方式同样重要 - 沟通至关重要
The Knowledge Portfolio
知识投资组合
Treat your knowledge like a financial portfolio:
- Invest regularly - Learn something new routinely
- Diversify - Know many different technologies
- Manage risk - Balance safe tech with high-risk/high-reward
- Buy low, sell high - Learn emerging tech before it becomes mainstream
- Review and rebalance - Reassess periodically
将你的知识视为金融投资组合:
- 定期投资 - 定期学习新知识
- 多元化 - 了解多种不同技术
- 管理风险 - 在安全技术与高风险高回报技术间取得平衡
- 低买高卖 - 在新兴技术成为主流前学习它
- 复盘与再平衡 - 定期重新评估
Suggestions:
建议:
- Learn a new language every year
- Read a technical book each month
- Read non-technical books too
- Take classes
- Participate in local user groups
- Experiment with different environments
- Stay current (newsletters, blogs, conferences)
- 每年学习一门新语言
- 每月阅读一本技术书籍
- 也阅读非技术书籍
- 参加课程
- 参与本地用户组活动
- 尝试不同的开发环境
- 紧跟技术前沿(通讯简报、博客、会议)
Communication
沟通
- Know what you want to say
- Know your audience
- Choose the right moment
- Choose a style
- Make it look good
- Involve your audience
- Be a listener
- Get back to people
- Documentation is part of the project, not after
- 明确你要表达的内容
- 了解你的受众
- 选择合适的时机
- 选择恰当的风格
- 让内容清晰美观
- 引导受众参与
- 学会倾听
- 及时回复他人
- 文档是项目的一部分,而非事后补充
Language Translation Notes
语言适配说明
Examples use generic pseudocode. Adapt to your language:
- PHP: ,
class,function, type hints-> - JavaScript/TypeScript: , arrow functions,
class. - Python: ,
class,def, type hints. - Java/C#: Direct mapping with access modifiers
Based on concepts from "The Pragmatic Programmer: Your Journey to Mastery" by David Thomas and Andrew Hunt.
示例使用通用伪代码。可适配你使用的语言:
- PHP:,
class,function, 类型提示-> - JavaScript/TypeScript:, 箭头函数,
class. - Python:,
class,def, 类型提示. - Java/C#:直接映射并使用访问修饰符
基于David Thomas和Andrew Hunt所著《程序员修炼之道:通向大师之路》中的概念。