三位Java Champion分享GitHub Copilot提效实战与最佳实践
How 3 Java Champions are using GitHub Copilot for increased productivity
一线资深开发者分享的Copilot实战复盘,包含Skills定制、模型切换策略及验证工作流,极具复用价值,建议Agent开发者参考其验证思路。
AI coding tools can generate code quickly, but speed alone does not solve the hardest software engineering problems. Developers still need to provide context, validate results, protect maintainability, and remain accountable for what ships.
AI 编码工具可以快速生成代码,但仅靠速度并不能解决最棘手的软件工程问题。开发人员仍需提供上下文、验证结果、保护可维护性,并对最终交付的内容承担责任。
To learn how experienced developers strike that balance, we spoke with three Java Champions, all with over a decade of experience in using Java. They shared concrete examples of using GitHub Copilot in production and open source, along with the practices they use to turn AI-generated output into reliable software.
为了了解经验丰富的开发人员如何把握这种平衡,我们与三位 Java Champions 进行了交流,他们使用 Java 的经验均超过十年。他们分享了在生产环境和开源项目中使用 GitHub Copilot 的具体案例,以及他们将 AI 生成的输出转化为可靠软件所采用的实践方法。
Here are the tips they shared with us.
以下是他们与我们分享的要点。
Meet the Java Champions
认识这些 Java Champions
- Vlad Mihalcea, founder of Hypersistence and author of the book High-Performance Java Persistence
- Patrick Baumgartner, software crafter at 42talents with 20+ years of Java experience
- Frank Delporte, senior technical writer at Azul and maintainer of Foojay.io with 15+ years of Java experience
- Vlad Mihalcea,Hypersistence 创始人,《高性能 Java 持久化》一书的作者
- Patrick Baumgartner,42talents 的软件工匠,拥有 20 多年 Java 经验
- Frank Delporte,Azul 的高级技术作家,Foojay.io 的维护者,拥有 15 多年 Java 经验
Vlad Mihalcea
GitHub profile: @vladmihalcea
GitHub 个人资料:@vladmihalcea
How has GitHub Copilot helped you recently?
GitHub Copilot 最近是如何帮助你的?
I’ve been using it to analyze, design, and implement various features in both Hypersistence Utils and Hypersistence Optimizer.
我一直在用它来分析、设计和实现 Hypersistence Utils 和 Hypersistence Optimizer 中的各种功能。
For example, I’ve been wanting for a long time to develop a web application that provides Optimizer event history so we can see how performance improvement efforts are materializing in application performance. Before AI, I kept postponing this task because it would have taken me weeks to develop. But using Copilot is like having a new team member, so I used it to create an app that will ship in the next version of Hypersistence Optimizer. Instead of weeks, this task took just two days to implement.
例如,我一直想开发一个 Web 应用程序,提供 Optimizer 的事件历史记录,以便我们能看到性能改进工作如何在应用性能中体现出来。在 AI 出现之前,我因为开发这项任务需要花费数周时间而一直推迟。但使用 Copilot 就像增加了一名新团队成员,所以我用它创建了一个将在下一个版本的 Hypersistence Optimizer 中发布的应用程序。原本需要几周的任务,现在只用了两天就实现了。
What’s your typical usage? Are you using GitHub Copilot as an IDE plugin or the GitHub Copilot app?
你通常如何使用它?你是将 GitHub Copilot 作为 IDE 插件使用,还是使用 GitHub Copilot 独立应用?
I use GitHub Copilot in IntelliJ IDEA because it’s convenient to run while reviewing source code or during a debug session.
我在 IntelliJ IDEA 中使用 GitHub Copilot,因为在审查源代码或调试会话期间运行它非常方便。
It’s very useful as a code assistant, and it helps me speed up both investigations and building prototypes for features that need validation.
它作为一个代码助手非常有用,帮助我加快了调查速度,并加速了需要验证的功能的原型构建。
I still review the plans and the code that is generated by AI since their goal is to improve my productivity, not replace me entirely. While AI provides the right answer in many situations, there are still times when the response is not satisfactory and requires my intervention.
我仍然会审查计划和 AI 生成的代码,因为它们的目标是提高我的生产力,而不是完全取代我。虽然 AI 在许多情况下能提供正确的答案,但仍有时回复不尽如人意,需要我的干预。
Can you share some tips and best practices? For example, which skills are you using?
你能分享一些技巧和最佳实践吗?例如,你使用了哪些技能?
I created my own skills so that whatever text Copilot generates looks like something I wrote by hand.
我创建了自己的技能(skills),以便 Copilot 生成的任何文本看起来都像是我亲手编写的。
This skill captures my voice from 65 of my published articles, so a draft comes back sounding like my blog instead of like a language model. This is really useful when generating documentation for this project, since it lets the LLM learn from 12 years of blogging and provide examples that follow the same principles, such as expressiveness, testability, and simplicity.
这项技能从我的 65 篇已发表文章中提取了我的声音,因此生成的草稿读起来像我的博客,而不是语言模型。在为本项目生成文档时,这非常有用,因为它让大语言模型能够从 12 年的博客写作中学习,并提供遵循相同原则(如表现力、可测试性和简洁性)的示例。
Throughout my career as a software engineer, I’ve learned that we spend far more time on code maintenance than on creating it. Therefore, because maintenance and stability are critical for existing products, I developed skills that help AI mimic existing code practices in accordance with the principle of least astonishment.
在我作为软件工程师的职业生涯中,我了解到我们在代码维护上花费的时间远远多于创建代码的时间。因此,鉴于维护和稳定性对于现有产品至关重要,我开发了帮助 AI 模仿现有编码实践的技能,以遵循最小惊讶原则。
One tip is to change the model type based on the type of operation. For thorough thinking, I use Opus with the 1 million context window and Extra High or Max reasoning. However, for simpler tasks, such as generating reports, release notes, or verifying documentation, I use lighter models that consume fewer tokens.
一个技巧是根据操作类型更改模型类型。对于需要深入思考的任务,我使用具有 100 万上下文窗口和极高或最大推理能力的 Opus 模型。然而,对于较简单的任务,如生成报告、发布说明或验证文档,我使用消耗更少令牌的轻量级模型。
Patrick Baumgartner
帕特里克·鲍姆加特纳
GitHub profile: @patbaumgartner
GitHub 个人资料:@patbaumgartner
Your work involves coaching teams. What is your approach?
你的工作涉及团队辅导。你的方法是什么?
A lot of my work happens while the normal business still has to keep running. You cannot stop everything for six months to “transform.” We usually start by solving immediate problems together, understand where the team currently stands, define where we want to go and how we will know that we are improving, and then move there step by step.
我的许多工作是在正常业务仍需持续运行的情况下进行的。你不能为了“转型”而停止一切长达六个月。我们通常从共同解决紧迫问题开始,了解团队目前的状况,定义我们要去的方向以及如何知道我们正在进步,然后一步步地实现目标。
Depending on the situation, that can mean Software Craft practices such as TDD, refactoring, continuous delivery and XP; architecture and modularisation with Spring Boot, Spring Modulith; Spring Security; optimising Java and Spring Boot applications for containers; or increasingly, agentic engineering.
根据情况的不同,这可能意味着采用软件工程工艺实践,如测试驱动开发 (TDD)、重构、持续交付和极限编程 (XP);使用 Spring Boot、Spring Modulith 进行架构设计和模块化;Spring Security;优化 Java 和 Spring Boot 应用程序以适应容器环境;或者日益增多的智能体工程 (agentic engineering)。
The important part for me is that I work with the team. We make decisions together. I don’t want a team to become dependent on me. Ideally, after some time they no longer need me except perhaps as a sparring partner.
对我来说重要的是我与团队一起工作。我们共同做出决策。我不希望团队对我产生依赖。理想情况下,经过一段时间后,他们不再需要我,除了可能作为陪练伙伴。
And maybe that explains why I find this new generation of AI tools so interesting: I like working with people, learning, experimenting, and solving problems. AI gives us another very powerful tool for doing exactly that.
这也可能解释了为什么我觉得这一代新的 AI 工具如此有趣:我喜欢与人合作、学习、实验和解决问题。AI 为我们提供了另一个非常强大的工具来 exactly 做到这一点。
Can you share a good story about how GitHub Copilot has helped you recently?
你能分享一个关于 GitHub Copilot 最近如何帮助你的好故事吗?
There are actually three very different examples that changed how I think about working with GitHub Copilot.
实际上有三个截然不同的例子改变了我对与 GitHub Copilot 协作的看法。
Let’s start with the first one.
让我们从第一个开始。
One was a migration of around 900 teaching slides across 15 presentations from Reveal.js to Marp. These were not simple slides. Many contain code, animations, and even interactive examples where I can change JavaScript live while teaching. More importantly, the presentations had already been battle-tested with students. The flow worked. Losing one small piece could break the story I use in the classroom.
其中一项迁移涉及将15个演示文稿中的约900张教学幻灯片从Reveal.js迁移到Marp。这些并非简单的幻灯片。许多幻灯片包含代码、动画,甚至交互式示例,我在授课时可以实时更改JavaScript。更重要的是,这些演示文稿已经过学生的实战检验。流程运行良好。丢失任何一个小部分都可能破坏我在课堂上使用的叙事结构。
Doing that migration manually would probably have taken me a week or more—and realistically, I might simply have avoided doing it because it was such tedious work.
手动完成这种迁移可能花费我一周或更长时间——而且现实情况是,我可能会因为工作如此繁琐而干脆避免去做。
With Copilot, I approached it differently. We first analysed the existing material, defined the target, created a migration plan, established constraints, provided examples, and defined what had to remain intact. Then we worked from the big structural changes down into the details.
借助Copilot,我采取了不同的方法。我们首先分析了现有材料,定义了目标,制定了迁移计划,确立了约束条件,提供了示例,并明确了哪些内容必须保持完整。然后我们从大的结构性变化入手,逐步深入到细节。
The really important part was verification.
真正重要的部分是验证。
We generated screenshots of the Reveal.js and Marp versions and compared them visually and algorithmically. We built a small application where I could run both slide decks next to each other to verify animations manually. We even compared the generated PDFs.
我们生成了Reveal.js和Marp版本的截图,并从视觉和算法层面进行了比较。我们构建了一个小型应用程序,让我可以将两个幻灯片集并排运行以手动验证动画。我们甚至比较了生成的PDF文件。
That meant the agent did not just say, “Migration complete.” We had evidence.
这意味着代理不仅仅说“迁移完成”。我们有证据支持。
The entire migration took me roughly eight to ten hours. I still owned the content, the teaching intent, and every meaningful change. Copilot could fix a typo automatically, but if content, versions, dates or meaning changed, that was something we discussed.
整个迁移过程大约花费了我八到十个小时。我仍然掌控着内容、教学意图以及每一个有意义的变更。Copilot可以自动修复拼写错误,但如果内容、版本、日期或含义发生变化,那就是我们需要讨论的事情。
For me, that experience reinforced an important principle: delegate execution, not responsibility. I own the result.
对我而言,这次经历强化了一个重要原则:委托执行,而非责任。我对结果负责。
Can you share the second example?
你能分享第二个例子吗?
A second example came from building a terminal UI application with Tamboui. It initially worked perfectly in Linux under WSL, and I had completely forgotten that somebody might run it directly in Windows CMD or PowerShell.
第二个例子来自与Tamboui一起构建终端UI应用程序。它在WSL下的Linux环境中最初运行完美,而我完全忘记了有人可能会直接在Windows CMD或PowerShell中运行它。
And then a real user did.
然后,一位真实用户确实这样做了。
They discovered that the Enter key was simply ignored in some forms. That is another principle I strongly believe in: ship software early, because you learn from how people actually use it.
他们发现Enter键在某些表单中被简单地忽略了。这是另一个我坚信的原则:尽早发布软件,因为你可以从人们实际使用它的方式中学习。
We used Copilot to turn that feedback into reproducible UI tests. On Linux, Copilot was navigating the application with tmux. Through working with it, I learned about psmux and could execute similar flows in PowerShell. We reproduced the problem, created a local fix, traced the real problem into Tamboui, and I submitted the upstream fix, which was merged.
我们使用Copilot将这一反馈转化为可复现的UI测试。在Linux上,Copilot使用tmux导航应用程序。通过与它的协作,我了解了psmux,并能够在PowerShell中执行类似的流程。我们重现了问题,创建了本地修复方案,追踪到Tamboui中的根本问题,并提交了对应的上游修复,该修复已被合并。
During this work, the test descriptions themselves became too large for the available context. So I asked Copilot to help me redesign the way the tests were represented. Instead of verbose tables containing identifiers, names and repeated descriptions, it proposed a much more compact arrow notation: step → step → input, with additional information only where it was critical.
在此过程中,测试描述本身变得过于庞大,超出了可用上下文的限制。因此,我请求 Copilot 协助我重新设计测试的表示方式。它没有使用包含标识符、名称和重复描述的冗长表格,而是提出了一种更为紧凑的箭头符号:step → step → input,仅在关键处附加额外信息。
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力