当前位置:首页 > 报告详情

重构顽固的遗留代码库.pdf

上传人: 竿*** 编号:981585 2025-11-29 58页 9.33MB

1、Refactoring Large,StubbornCodebasesJake ZimmermanGetty D.RitterNovember 19,2024jezaisamanra1Complaints about stubborn codebasesOur code isnt modular enough!This dependency is 10 years out of date!We need to change how we talk to the database!We can refactor to a happy state!2Best to centralize the r

2、efactor Have one team drive the refactor:concentrates expertisemost problems will be repeat problemsincentivizes automationfewer engineer-hours overallmore likely to finishno need to wait for each team to plan and prioritize3Centralized migration needs two things:Leverage over the codebaseWay to rat

3、chet incremental progress4Toyou need toand torefactor a large,stubborn codebasehave a point of leveragepick good ratchets.5Agenda Improving developer satisfaction with SorbetMaking a Ruby monolith more modularLessons learned from ratchets ratcheted67 Stripes developers were unhappy“hard to understan

4、d”(sentiment from company-wide survey)“waiting for tests is slow”“only breaks in production”“dont trust the docs”“too much low-quality code”8 Building Sorbet introduced leverage“hard to understand”“waiting for tests is slow”“only breaks in production”“dont trust the docs”“too much low-quality code”(

5、sentiment from company-wide survey)IDE aids understanding all code type checks in seconds type checker catches bugs in CI runtime makes types trustworthy bad code is hard to type9Brief history of Sorbet?Began fall 2017Stripe:800 employees(200 400 engineers)Initial project:3 engineers,full timeTimeli

6、ne9 months to build Sorbet but has served as the foundation for hundreds of codemods3 months to get to 75%adoptioncontained to just three engineers10Aside:you can do it too!?Tools that you can use to bootstrap something:,your languages linter,BYO:tree-sitter parsers,LSP server libraries,GitHub code

word格式文档无特别注明外均可编辑修改,预览文件经过压缩,下载原文更清晰!
三个皮匠报告文库所有资源均是客户上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作商用。
1. **代码重构的重要性**:文章强调了重构大型、顽固代码库的必要性,以提升开发效率和满意度。 2. **集中式重构**:建议由一个团队主导重构,以集中专业知识,减少工程师时间,并提高完成率。 3. **Sorbet的案例**:Sorbet作为Ruby单体应用的类型检查工具,通过引入类型检查提升了开发者的满意度。 4. **模块化的重要性**:文章指出,模块化可以减少代码复杂性,提高开发速度和性能。 5. **杠杆和阶梯策略**:通过使用Sorbet和严格依赖性等工具,逐步引入类型检查,以实现渐进式重构。 6. **工具和工具链**:文章强调了工具和文档的重要性,以及组织支持对于成功重构的必要性。 7. **Sorbet的进展**:Sorbet在Stripe内部推广,仅用三个月就达到75%的采用率。 8. **两阶段阶梯策略**:Sorbet采用了两级阶梯策略,以逐步引入类型检查,并提供了自动修正和编辑器集成等工具支持。
"如何轻松重构老旧代码库?" "Sorbet如何提升开发者满意度?" "模块化重构的秘诀是什么?"
客服
商务合作
小程序
服务号
折叠