Login
You're viewing the ruby.social public feed.

Replies

  • Aug 20, 2024, 2:10 AM

    @codeDude when I was much younger, I was expressly told by someone who knows these things that a single return makes it easier to validate safety critical code. I accepted that without a follow-up question, so I don't know why 😕

    💬 0🔄 0⭐ 2
  • Aug 20, 2024, 4:33 AM

    @codeDude Early in my career, I developed software in Java, which doesn't support multiple returns.

    So in postgrad, when I saw Python examples with multiple returns, I clutched my pearls big time. :P

    My tutors said that multiple returns are acceptable. I took their word for it, and occasionally use them, but I still prefer to avoid them.

    For example, if there's a sprawling function littered with disparate and unrelated exit points, a rethink might be necessary.

    💬 0🔄 0⭐ 0