Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Static Type Checking in Rails with Sorbet by Hung Harry Doan "Sorbet is a powerful static type-checking tool for Ruby. Type checking can catch errors early and improve the developer experience—and with the right tools, it can even be used with dynamic methods in Rails. In this talk, we’ll cover the basics of type checking and share the lessons learned from our adoption of Sorbet type checking across our 2,500-file codebase in just six months. We’ll talk about the technical challenges we faced and how we solved them with a new Sorbet-Rails gem, which makes it easy to gradually integrate type checking into your Rails app & improve your team’s efficiency." __________ Harry Doan is a Staff Software Engineer at the Chan Zuckerberg Initiative. He’s passionate about building great developer productivity tools and applications for the community. He created Sorbet-Rails to help Rails developers benefit from static type checking. In his free time, he can be found meditating or studying Buddhism teachings.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In the talk titled "Static Type Checking in Rails with Sorbet," Hung Harry Doan, a Staff Software Engineer at the Chan Zuckerberg Initiative, explores how to implement static type checking in Ruby on Rails applications using the tool Sorbet. The presentation covers a variety of aspects related to Sorbet and its integration into a codebase that comprises over 2,500 files, emphasizing the following key points: - **Intro to Static Type Checking**: The discussion begins with an introduction to static type checking and its significance in catching errors early, improving code maintainability, and enhancing developer productivity. - **Sorbet Overview**: Sorbet is highlighted as a fast and powerful static type checker specifically designed for Ruby, which supports gradual typing and can be integrated with text editors for real-time type checking. - **Real-World Application**: The speaker shares insights into the experiences of adopting Sorbet across their large codebase, demonstrating how it was able to uncover subtle bugs, such as misspelled method calls that would typically go unnoticed until runtime. - **Challenges with Rails**: Doan discusses the challenges posed by metaprogramming in Rails when it comes to type checking, as Rails often generates methods dynamically, complicating type inference. - **Introduction of Sorbet-Rails Gem**: To address the unique challenges posed by Rails, the creation of the Sorbet-Rails gem is introduced, which helps bridge the gap between Sorbet and Rails applications. This gem facilitates the generation of method signatures, thereby enhancing the ability to type check dynamic Rails methods. - **Implementation Strategies**: Key strategies for implementing Sorbet in a Rails environment are shared, including generating RBI (Ruby Interface) files, leveraging Rails reflections for dynamic methods, and encouragement toward adopting a gradual approach to type checking. - **Adoption Metrics**: The speaker discusses metrics for measuring the adoption of type checking within their team, including method call coverage and the number of files type-checked, along with strategies to maintain engagement and support among team members. - **Conclusion and Insight**: The talk concludes with a recommendation to the audience to explore Sorbet for their own projects, emphasizing the potential for improved code quality and developer efficiency. The presenter invites collaboration and contribution to the Sorbet community, highlighting the positive impact it has had on their workflow. In summary, Hung Harry Doan provides a compelling overview of the benefits and challenges of incorporating static type checking into Ruby on Rails applications using Sorbet, offering practical advice and insights for teams considering similar implementations.
Suggest modifications
Cancel