4 ms·
I think SWE is a very young field. Just 50 years ago GOTO was commonplace (apparently?). In any case I think the future hold some interesting prospects, with co
by bruce343434 4y ago
I think SWE is a very young field. Just 50 years ago GOTO was commonplace (apparently?). In any case I think the future hold some interesting prospects, with copilot and gpt and all.
- SonOfKyuss 4y agoGOTO is still perfectly acceptable and common practice in the Linux kernel and other widely used codebases. https://www.kernel.org/doc/html/v5.0/process/coding-style.html#centralized-exiting-of-functions https://www.kernel.org/doc/html/v5.0/process/coding-style.ht...
- ghostpepper 4y agoIf 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; }