Follow

If you don't understand an argument for something, but still use it anyway, you are probably wrong. This is called cargo culting.

Inspired by some dude telling me git's code is bad because it uses goto a lot.

@sir
The story behind that term is really weird, I suspect you know but if others don't know it yet:
en.m.wikipedia.org/wiki/Cargo_

I usually use the term for steps you take to solve a problem where you have no idea what is actually happening in the background. Turning something off and back on is often a good example. Or blowing in a game cartridge, or hitting a TV.

For my work I have a list of 5 or 6 of those that may help in some situations. Sometimes called rain dances too.

@sir I haven't heard it used for describing bad arguments, but I like it. I'm going to see if I can use it like that too 🤔

@sir As someone who's not new but also not too well seasoned, I understand that labels and gotos don't communicate intent to your future self and to those who may also be reading your code, but in what situation is using a goto in C a good practice?

@Lofenyy mainly for error handling, to branch to an alternative exit condition which cleans up any resources allocated during the function

Sign in to participate in the conversation
Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!