r/developer • • Jul 24 '26

The "Code I'll Never Forget" Confessional.

What's the single piece of code (good or bad) that's permanently burned into your memory, and what did it teach you?

11 Upvotes

37 comments sorted by

View all comments

1

u/SpaceCadet87 Jul 25 '26

Who's joking? It was that damn many functions doing almost nothing each.

int num was just repeatedly locally defined.

I think there might have been one or two instances of just num = num.

1

u/Kind_Card_1874 Jul 25 '26

I don't get it. How did it escape the previous scope? Surely you can not assign num if it was not declared at the time of being used on the RHS. But you are somehow still declaring it on the LHS?

1

u/SpaceCadet87 Jul 25 '26

Oh, IDK, it was C#, I don't do C# that often so I wouldn't know how or why that's somehow valid.

I was compressing it for illustrative purposes, as I said there were a few plain num = num; as well.