3 ms·
I do not use goto in my code. What do I do wrong? :) Ok, I have to admit that I used it on C64 in the 80s. Anyways, exceptions are sort of gotos or at least th
by istvan__ 11y ago
I do not use goto in my code. What do I do wrong? :) Ok, I have to admit that I used it on C64 in the 80s.
Anyways, exceptions are sort of gotos or at least they can behave that way.
- EugeneOZ 11y agoNo, exceptions are incomparable much harmful because they don't have destination, they just hysterically run, crashing everything on their way.
- istvan__ 11y agoI said "sort of"...
- sklogic 11y agoIf you're not implementing fast FSMs, fast bytecode interpreters (and dynamic dispatchers in general), and you're not using metaprogrming to the full power, not implementing multiple embedded DSLs - then you can live without a goto. Otherwise it is essential.
- pjmlp 11y agoMetaprogramming to the full power sounds like Lisp. It doesn't have goto.
- sklogic 11y ago> Metaprogramming to the full power sounds like Lisp. It does, yes, although many Lisps got a pretty limited backend for this sort of things. My preferred metaprogramming environment must have a fallthrough mode for allowing generating low-level code where Lisp semantics is not sufficient. Rust seems like a very good target platform in this sense, so the lack of goto really hurts. > It doesn't have goto. Of course they do (tagbody in Common Lisp, for example). And when they don't, it's often relatively easy to add one.
- pjmlp 11y ago> Of course they do (tagbody in Common Lisp, for example). And when they don't, it's often relatively easy to add one. I was wrong, however it is much more limited than the goto everywhere from C, as where the labels are located is clearly defined in the tagbody and not in every possible statement.