4 ms·
Something like go's defer makes most uses of goto (failure handling) unnecessary. However, there is still the "code a state machine" use case for goto.
by qznc 13y ago
Something like go's defer makes most uses of goto (failure handling) unnecessary. However, there is still the "code a state machine" use case for goto.
- loumf 13y agoWhich we are trying to eliminate with tail-call-optimized mutually recursive functions.
- klodolph 13y agoWhich are semantically less clear than goto, when you are working with something that is semantically a state machine.
- dragonwriter 13y agoActually, I think that mutually-recursive functions are more semantically clear than goto for a state machine, though using explicit state objects is even more clear than either (though probably less efficient.)