• xmunk@sh.itjust.works
    link
    fedilink
    arrow-up
    88
    ·
    1 day ago

    Still not as excellent as On Error Resume Next

    Imagine the sheer idiocy genius required to add a language feature where, if an error occurred, the handling method is to just pretend that line of code never existed and continue onto the next line.

    VBA is truly the language of savants.

    • wizardbeard@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      21
      ·
      1 day ago

      PowerShell does that by default, and it’s my least favorite feature in my most used language.

      $ErrorActionPreference = Stop

      At the start of almost every script.

      • locuester@lemmy.zip
        link
        fedilink
        English
        arrow-up
        2
        ·
        15 hours ago

        Very different. This means default ignore all errors and continue to the next line. You’d have to explicitly catch every line in most(all?) other languages.

      • Skull giver@popplesburger.hilciferous.nl
        link
        fedilink
        arrow-up
        1
        ·
        15 hours ago

        Ignoring every exception, including divisions by zero, is something I’ve never seen outside of BASIC and shell scripting. Even C and assembly will shit themselves when you do some of the shit that ON ERROR RESUME NEXT will ignore.