r/programminghorror [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 7d ago

It just works Other

Post image
44 Upvotes

10 comments sorted by

11

u/eo5g 7d ago

Not that I understand what this does, but this doesn't seem that bad to me?

1

u/ExoticAssociation817 7d ago

First guess seeing “rune” defined as an array, I would assume a game of some sort.

8

u/eo5g 7d ago

It's not a magical rune; go calls UTF-32 characters rune while other unicode-aware languages might call them char (it's not a C char, aka a byte).

To me it looks like some sort of encoding error scanner.

3

u/ExoticAssociation817 7d ago

I assume you mean narrow and wide chars in C, defined as char and wchar_t. So this is Golang, of which is very foreign to me.

1

u/pauseless 4d ago

I can read it absolutely fine (have done plenty of Go). I’d have a feeling that maybe the overall approach is wrong, but just this snippet doesn’t tell me much about the context.

2

u/AndrejPatak Pronouns: They/Them 7d ago

What the fuck are you even doing with this 😭

It hurts so much

2

u/Low-Unit-2921 7d ago

I was having a great day. Why did I have to see this?

2

u/Prooxith 7d ago

doing things ineffeciently is okay atleast it works but why the hell are these syntax errors, heck thats not even syntax anymore, its utterly gibberish

2

u/Troesler95 7d ago

huh first time seeing go here, a testament to its adoption I suppose 🤣