← Graph

Could types be defined outside the class like RBS?

question 2 connections

Audience observation that Ruby developers dislike verbose code, which is what drives them away from types, and that RBS lets you declare types outside the class — has Drapper experimented with this? Answer: no. Switching to Literal already writes fewer lines than a hand-written initializer plus attr readers plus validations, so verbosity isn't a deficit. He personally values being able to scroll to the top of any class and immediately see and click through every prop's type, so he prefers inline.

answer_summary
No — Literal already reduces line count and Drapper prefers inline types for local documentation and click-through navigation.
question Could types be defined outside the class like RBS?
about
RBS tool
References RBS's external type-file capability.
question Could types be defined outside the class like RBS?
asked_at
Q&A question on verbosity and external type files.

Provenance

Read by
1 extraction