@monorail goto pizza is the name of a pizza restaurant owned by programmers isn't it

@wallhackio @The_T @monorail If I have any excuse to, then of course I do :blobcat_mlem:

Though that doesn't happen very often... And in my experience, if my code ends up having a lot of GOTOs, then that's because I am thinking wrongly about the logic and need to take a step back and find a better structure...

@vaporeon_ @The_T @monorail i was curious if you had any strong feeling about it

i've only used GOTO in TI-BASIC because the menu feature requires it, other than that i dont use it out of habit since people tend to discourage its use nowadays

@wallhackio @vaporeon_ @The_T @monorail I think it's acceptable for error handing in some C stuff and derivatives (to the extent that C is acceptable), but in general I would frown on "backwards" goto that jumps into different functions or earlier in the same one just because it makes things hard to follow. (Except, as you mention, where there aren't really functions, in which case, sure, it's a jump, you need them.)

@aschmitz @vaporeon_ @The_T @monorail how are arguments from a function treated if you jump into it?

@wallhackio @aschmitz @monorail No, as far as I know? Unless you use setjmp() / longjmp(), in which case the registers and such get saved in a jump buffer. But I've basically never had a need for setjmp()...

If I remember correctly, COBOL lets you just GOTO to a different function, though! I don't know how that's implemented, I've never actually programmed COBOL, I've only read about it...

@vaporeon_ @wallhackio @monorail Yeah, between functions is just in other languages, not C, sorry. (But yeah, more just "error handing is okay if you don't have better alternatives, limited forward use is less okay but can be understandable, and anything else you're just making spaghetti, unless it's the only flow control you have". I guess there are certain kernel-type constraints where it can be necessary too, though even there do it as little as feasible.)

@aschmitz @wallhackio @monorail May I ask which language you program in, that allows to GOTO between different functions? :blobcatmlem:
I'm assuming it's something old, considering that most of the modern languages don't want to let you GOTO at all...

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.