@noelrap just read it! I hadn't realized that the Ruby docs say not to use `protected`. Interesting. (I suspect I've probably mentioned this before, but the only use I've ever found for it is for defining Comparable for custom value objects. Which of course only works for homogenous collections.)

2
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
Keith Gable :whyfox:🇺🇦🌻

@geeksam @noelrap this was a huge a ha moment for me the last time Noel wrote about it. I just had to let go of thinking of these as OO visibility and instead thinking of how they work with messages in the Smalltalk sense. And in that context, Ruby’s protected is really just a badly named something else, and only public and private actually make any sense. Which is why we have private constants but not protected constants.

0
6mo
Alessandro Fazzi

@geeksam @noelrap this is a use case for `protected` I had recently gist.github.com/alessandro-faz I continue asking myself if it does make sense

1
6mo
Replies