Writing Better, Type-Safe Code with Sorbet

1 · Shopify · June 24, 2020, 5:02 p.m.
Summary
Hey, I’m Jay and I recently finished my first internship at Shopify as a Backend Developer Intern on the App Store Ads team. Out of all my contributions to the ad platform, I wanted to talk about one that has takeaways for any Ruby developer. Here are four reasons for why we adopted Sorbet for static type checking in our repository. 1. Type-Safe Method Calls Let’s take a look at an example. On the last line we call the method action and then call value.to_h on its return type. If action returns...