News for hackers. Stuff that matters.
Re:Pattern Matching in Ruby 2.7 (2019) by zozbot234 on Thursday January 09, 2020 @06:43AM (#22000362)
Destructuring ("digging into" a type) makes little sense with open records and sums, which OOP introduced into common use. The "closed" ('final', 'sealed' etc.) case where destructuring makes sense was disregarded for some time because it was thought that extensibility was always the appropriate choice.

Today, "open" extensibility mechanisms are considered a bit problematic because it's never really clear what invariants they should preserve, so maintaining correctness is an issue. A "closed" interface makes it essier to specify related invariants.

There are no comments on this comment yet.