Okay, just a hint: if you are writing C, C++ or any other compiled language you aren’t doing anyone a favor using one character variable names. It literally costs nothing to make things clear. One character variable names are terrible.

While I’m on it, gotos are similarly bad. If you feel you need to do either of these, DON’T.

A good friend of mine said, jokingly, “Good code is hard to write, it should be difficult to understand!”

@feloneouscat Yes! I totally agree about the variable names, with the possible exception of if you're implementing some very abstract mathematical function whose variables can't really be mapped onto more meaningful names.

I have only *somewhat* more mixed feelings about gotos - while I certainly don't want to see them in lasting code, I sometimes use them when I'm testing something something out & realize I made boneheaded structural mistakes... then refactor them out later.

@IrelandTorin

Rule of thumb: if you feel you”need” a go to, you need to create another function. It costs nothing and adds clarity.

Follow

@IrelandTorin

Some clarification: some I mentioned this to have argued that a three line function is silly.

My counter argument is, “Then it should be easy to write” — the computer doesn’t care, why should we? What is important is does it make the code easier to read and update? If it does, then it is a win.

Gotos are messy and hard to follow. I wrote assembly language for almost a decade where it is unavoidable. Avoid it. This is why assembly is hard and error prone.

Sign in to participate in the conversation

CounterSocial is the first Social Network Platform to take a zero-tolerance stance to hostile nations, bot accounts and trolls who are weaponizing OUR social media platforms and freedoms to engage in influence operations against us. And we're here to counter it.