• Dyskolos@lemmy.zip
    link
    fedilink
    arrow-up
    154
    ·
    1 day ago

    I really really dig the fuckaround/findout. It paints the try/catch with a more dreadful undertone and reeks of mystery.

    • merc@sh.itjust.works
      link
      fedilink
      arrow-up
      9
      ·
      19 hours ago

      Yeah, I love that one.

      “Try” is too hopeful. “fuck_around” makes it clear that you know what you’re doing is dangerous but you’re going to do it anyhow. I know that in some languages wrapping a lot of code in exception blocks is the norm, but I don’t like that. I think it should be something you only use rarely, and when you do it’s because you know you’re doing something that’s not safe in some way.

      “Catch” has never satisfied me. I mean, I know what it does, but it doesn’t seem to relate to “try”. Really, if “try” doesn’t succeed, the corresponding block should be “fail”. But, then you’d have the confusion of a block named “fail”, which isn’t ideal. But “find_out” pairs perfectly with “fuck_around” and makes it clear that if you got there it’s because something went wrong.

      I also like “yeet”. Partly it’s fun for comedic value. But, it’s also good because “throw” feels like a casual game of catch in the park. “Yeet” feels more like it’s out of control, if you hit a “throw” your code isn’t carefully handing off its state, it’s hitting the eject button and hoping for the best. You hope there’s an exception handler higher up the stack that will do the right thing, but it also might just bubble all the way up to the top and spit out a nasty exception for the user.

    • jballs@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      28
      ·
      1 day ago

      The whole thing was pretty damn good all the way through. The only thing that had me wondering was

      Tea
      

      Until it got to

      SpillTea
      

      Well played.