Experiment: Fully adding Sorbet and RBS to a small project
02-Nov-2023 990
To get a better understanding of the value of gradual typing in Ruby projects I picked a small completely finished side project and did 3 experiments:Adding Sorbet at strict level to all files without metaprogramming.Adding RBS annotations to all files and Running Steep on strict setting.Adding Simplecov and raising line and branch test coverage to maximum.Here is what I learned:Both Sorbet and RBS found the same two bugs with RBS uncovering one extra small issue.Raising test coverage to maximum uncovered more bugs and more small issues than typing, including both bugs that gradual typing found.Sorbet feels like a more polished project, probably becasue some of the largest Ruby companies are using it. This is most noticeable in its excellent documentation.Both typing approaches were most painful around the (relatively light) meta-programming used in the project. Raising test coverage with Simplecov unsurprisingly had no issues there.
Experiment: Fully adding Sorbet and RBS to a small project #ruby #rubydeveloper #rubyonrails #Experiment: #Fully #adding #Sorbet #small #project https://rubyonrails.ba/link/experiment-fully-adding-sorbet-and-rbs-to-a-small-project