7 Matching Annotations
  1. Jun 2023
    1. Importantly, raising a warning or error message from your own program means you have control over the quality of the message.

      And, contrasting most built-in errors, it can give a user instructions on how to fix it.

    2. In many programming languages, this is done in a try... except or try... catch block

      Maybe an example would be nice. try: do_risky_thing except: handle_error else: continue

    3. if my_assumption is TRUE: continue else: do something

      The "continue" part could be long and create difficult to understand nesting, or it could be a function which creates another layer of nesting. Code-flow-wise I would turn it around. This way you have abort criteria at the beginning and the rest of the code below.

      if my_assumption is not TRUE: do something else: continue

      or even better, skip the else for less nesting:

      ``` if my _assumption is not TRUE: do something abort

      continue ```