• Riskable
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 years ago

    I wouldn’t say Protocols are more “fragile”… They’re more strict.

    • plistig@feddit.de
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 years ago

      The opposite is true. If you have two interfaces that contain methods with the same name, then they have the same typing.Protocol. It is not possible to specify preconditions or contracts, as you would with abc.