Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If anyone is curious, it's not just used to make unreadable spaghetti code. There are certain common paradigms, eg.

  int do_stuff_in_order(void) {
      int ret = init_a();
      if (ret != success) goto out;

      ret = init_b();
      if (ret != success) goto error1;

      ret = init_c();
      if (ret != success) goto error2;

      return 0;

      error2:
      teardown_b();

      error1:
      teardown_a();

      out:
      return ret;
  }


Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: