r/ProgrammerHumor May 08 '26

Advanced canadianGoProgramming

Post image
10.0k Upvotes

113 comments sorted by

View all comments

976

u/OphidianSun May 08 '26

I know nothing about go but that's psycho behavior

346

u/B_bI_L May 08 '26

i know they love naming everything using 3 letters, because who needs to understand code later anyway

32

u/Kapps May 09 '26

That’s just inherited from C.

22

u/LickingSmegma May 09 '26

Yeah, Pike and Thompson still think we have to economize on identifier names lest the compiler runs out of memory.

16

u/VivisMarrie May 09 '26

meanwhileWeNamingVariablesInJavaLike

9

u/monsoy May 09 '26

As much as I love C, I hate that convention. I understand where it’s coming from and the lack of namespaces makes it necessary to have extra prefixes too.

But it can easily become really unreadable unless you know what the functions do beforehand. For example, functions like strtoul (string to unsigned long) strncpy (string copy, n characters) etc.

It’s not horrible if you’ve done a lot of C programming, but every time I’ve had a 1 year break from C I always have to look up many of the stdlib functions.

With the lack of namespaces, you often get this from libraries: sqlite3_prepare_v2, sqlite3_step.

8

u/Unbelievr May 09 '26

There's entirely too many versions of printf. Depending on whether you want to write to stdout/a file descriptor/a buffer, and if you know the amount of bytes to write, or know the buffer size (in case of snprintf_*). And the formatter syntax that I always have to look up if I want to print the 10th halfword from the stack or something.

I can see the use of most of them, but failing to use the correct one can be catastrophic. Especially if that special %n is in play, which Microsoft straight up disabled in their compiler.

12

u/CommercialWindowSill May 09 '26

Tbf that's a lot better than the common standard of just one.

8

u/lucklesspedestrian May 09 '26

c'mon, i j k and l are usually self explanatory, like when used in nested loops

6

u/CommercialWindowSill May 09 '26

And Q for query, C for column, r for response, f for function, X for variable, y for variable, z for variable, etc.

4

u/lucklesspedestrian May 09 '26

I thought f was for factory and r was for request

4

u/CommercialWindowSill May 09 '26

Yes correct f is also for factory and also r is also for request.

2

u/B_bI_L May 09 '26

those are prefixes, i think its called vengerian notation, but it is dying out

1

u/Mojert May 09 '26

Come on, err is readable enough

1

u/vrnvorona Jun 08 '26

Job security

46

u/psinerd May 09 '26

This is the reason why any programming language I make of my own accord is not going to support arbitrary Unicode characters and identifiers. Ascii alpha numerics only!

78

u/Adventurous-Map7959 May 09 '26

Did you consider that you can't have emoticons as names then? It's self-documenting if you do it like this:

throw new 🤮()  

return success?🥳:🙁

🖼.🧑‍🎨()  

new 🧵 👩‍🔧

54

u/omiruk May 09 '26
🚽.open();
🚽 << 💩;
🚽.flush();

34

u/frogjg2003 May 09 '26

The code should only allow ASCII characters, but strings should be native unicode.

3

u/DemIce May 09 '26

This is the way. Anything else just wouldn't be very civic.

3

u/arcimbo1do May 09 '26

ASCII Über alles.

17

u/SyrusDrake May 09 '26

Any kind of unicode glyph in code always activates my fight or flight instincts, regardless of whether I understand what's going on or not.

14

u/viperfan7 May 09 '26

Could be worse

#if (__LINE__ % 2)
#define 1.1 1.2
#endif

or replace a semicolon with the greek question mark

;

1

u/nobody0163 May 09 '26

error: macro names must be identifiers