@pointlessone

I like this structure

The code samples in the next article do something similar (in that they pipe the data through a separate class) I but don't quite call the class VerifiedUser -- If you don't mind I'd like to mention that as an option (attributing you and linking to this post).

Thanks!

2
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
PointlessOne

@noelrap Sure. It's not like I invented it. This is thoroughly discussed in a lot of material for newcomers to strongly typed languages.

0
3mo
PointlessOne

@noelrap I understand why this whole typing thing seems a bit foreign in Ruby. Basically for all the Ruby eternity we were writing unsound code from the typing perspective. Trying to adapt a more strict system to our lax code will fill awkward. Adapting our code to a proper type system is a more productive approach. That said, even a partial typing of our existing code is useful so we can start there. Get used to explicitly type our interfaces at least to some degree and maybe eventually we’ll adopt new ways of writing code that are more suited to stronger typing.

0
3mo
Replies