Ruby refinements and the sorbet type checker

28-Nov-2019 2102
But now we sacrifice readability by defining what we will do with the result before we tell the user what we are doing in the first place. To me, calling the rmeove_nil_keys method overshadows the actual function we are performing. The method also now doesn’t depend on the instance state so we end up moving it to a class method, in short, we now have a MyClass.remove_nil_keys which makes no sense and you just know that from SomeUnrelatedClass someone will call MyClass.remove_nil_keys or copy and paste it to where it’s additionally needed.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle