• Blackmist@feddit.uk
    link
    fedilink
    English
    arrow-up
    5
    ·
    9 months ago

    I prefer a bunch of

    if (fucked_up) {return(error_code);}

    for checking common errors.

    • DWin@sh.itjust.works
      link
      fedilink
      arrow-up
      2
      ·
      9 months ago

      Yup, never nest.

      All the conditions should be checked and returned if they failed as you go through the function with the successful response being the last line.