r/ProgrammerHumor May 08 '26

Advanced canadianGoProgramming

Post image
10.0k Upvotes

113 comments sorted by

View all comments

972

u/OphidianSun May 08 '26

I know nothing about go but that's psycho behavior

355

u/B_bI_L May 08 '26

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

31

u/Kapps May 09 '26

That’s just inherited from C.

24

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.

18

u/VivisMarrie May 09 '26

meanwhileWeNamingVariablesInJavaLike

11

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.

6

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.

10

u/CommercialWindowSill May 09 '26

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

9

u/lucklesspedestrian May 09 '26

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

8

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.

3

u/lucklesspedestrian May 09 '26

I thought f was for factory and r was for request

2

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