• bjornsno@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    24 days ago

    My biggest pet peeve is the complete inability to annotate a set of known exceptions that a function raises in a machine readable way. The discussion about it is quite heated.

    • FizzyOrange@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      24 days ago

      In fairness that approach hasn’t really worked in other languages. It was so unpopular in C++ that they actually removed the feature, which is almost unheard of. Java supports it too but it’s pretty rarely used in my experience. The only place I’ve seen it used is in Android. It’s unpopular enough there that Kotlin doesn’t support it.

    • jjjalljs@ttrpg.network
      link
      fedilink
      arrow-up
      1
      ·
      24 days ago

      Interesting. I’ve never felt a need for this, and as the other reply here said it was really unpopular in other languages.

      I would have guessed you would have said something about how it’s annoying to type callable arguments, and how Protocol exists but doesn’t seem that widely known.