News for hackers. Stuff that matters.
Re:Lies we tell ourselves to keep using Golang by bazoom42 on Tuesday November 26, 2024 @07:57AM (#42245299)
Is “goto” just used to mean “bad and evil” here? Because exceptions are not a goto anymore than a return is a goto. The problem with goto is it can jump to any arbitrary place in your code. Exceptions will only go to catch-blocks up the call stack, which presumably you have written on purpose.
Re:Lies we tell ourselves to keep using Golang by vaylian on Tuesday November 26, 2024 @09:11AM (#42245906)
> Because exceptions are not a goto anymore than a return is a goto

Not true at all

* goto goes to a specific hard-coded address

* return looks up the previous address from the stack and goes there

* exceptions are a complex mess that require branching logic to determine where to resume execution

Re:Lies we tell ourselves to keep using Golang by abtinf on Tuesday November 26, 2024 @06:16PM (#42251207)
Very well put.