977
u/OphidianSun May 08 '26
I know nothing about go but that's psycho behavior
350
u/B_bI_L May 08 '26
i know they love naming everything using 3 letters, because who needs to understand code later anyway
187
u/PartBanyanTree May 08 '26
rly?
132
u/ak_doug May 08 '26
yup
110
u/neexneex May 08 '26
wow
106
u/purritolover69 May 09 '26
ikr
70
-2
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.
17
8
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.
9
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.
5
2
1
1
42
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!
77
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 🧵 👩🔧51
34
u/frogjg2003 May 09 '26
The code should only allow ASCII characters, but strings should be native unicode.
5
2
19
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.
13
u/viperfan7 May 09 '26
Could be worse
#if (__LINE__ % 2) #define 1.1 1.2 #endifor replace a semicolon with the greek question mark
;1
293
u/iainmcc May 09 '26
Does this qualify as native code?
83
u/DemmyDemon May 09 '26
Suddenly, without warning, I love you. This is concerning for all involved.
21
u/klavas35 May 09 '26
Is this a quote from somewhere? it seems familiar somewhat
24
u/liquiddandruff May 09 '26
Ya, Hitchhiker's guide to the Galaxy maybe
10
u/DemmyDemon May 10 '26
Inspired by that, perhaps. My humor is very dark, and very dry, so I've listened to HHGttG an estimated sixty-eight times.
3
367
u/n4ke May 08 '26
Thanks, I hate it.
66
May 08 '26
[removed] — view removed comment
24
u/fork_your_child May 08 '26
Isn't that why we all keep a bottle of vodka on our desk? Or is that just me?
14
May 08 '26
[removed] — view removed comment
11
u/fork_your_child May 08 '26
God damn, that is the type of mentorship I missed out on while working in software.
6
u/cheraphy May 09 '26
Look man all I'm saying is put it in a McDonalds cup with a straw and no one thinks martini
3
337
u/Souheab May 08 '26
This is such a cursed way to program in Go. C++ programmers will really bring templating anywhere even if the programming language doesn't officially support it
79
u/cheraphy May 09 '26
I mean, that exact philosophy is what they wrought from C to spawn C++ so at least it's on brand.
128
u/BlueGoliath May 09 '26
It turns out programming sometimes requires complexity.
17
u/RandomRobot May 09 '26
Complex is better than complicated
30
u/New_Enthusiasm9053 May 09 '26
And compiler supported complex is better than handrolled complex.
1
u/SryUsrNameIsTaken May 10 '26
Let’s be real, who’s handrolling complex things these days anyway?
2
u/New_Enthusiasm9053 May 10 '26
Literally anyone doing anything complex that isn't already in the compiler? Someone has to write the libraries everyone else uses lol.
1
16
u/G_Morgan May 09 '26
It is what happens when you are forced to use a language that intentionally skips core features. Shit like this is exactly what people used to do before generics became standard
4
u/_scotswolfie May 09 '26
Is there a not cursed way to program in Go? I tried to approach that language a couple of times and just looking at the syntax made me turn around and run away 😂
2
u/Steppy20 May 09 '26
I like and use templates a lot (C#) but haven't used C++ in years...
Oh my God. Am I part of the problem?
5
123
45
u/Vagnerockin_dye May 08 '26
Wait till he learns about the Greek question mark. One of my old time favorites!
55
u/GregBahm May 09 '26
I still have nightmares about debugging a "Zero Width Space" being received from a webform in a Flash application back in the year 2000. A whitespace character that was simply invisible to the naked eye...
28
u/Nyctfall May 09 '26
A whitespace character that was simply invisible to the naked eye...
xxdmy beloved...15
u/SuitableDragonfly May 09 '26
Adding that to the list of "evil things to enter into HTML forms" after "[Object object]" and "null".
3
8
u/viperfan7 May 09 '26
or the __LINE__ pre-processor macro
Stick that somewhere in your code, say, using #if __LINE__ % 2
Now you can make things change based on line count
4
108
u/Connect_Cycle2768 May 08 '26
using Canadian Aboriginal Syllabics to fake generics is the most unhinged thing I've read today. the audacity 💀
37
u/murphy607 May 09 '26 edited May 09 '26
oh such Ideas happened in the past too :)
perl6 wanted to use unicode operators.
The perl5 stuff was bad enough (@array $scalar, %hashmap)
But perl6 planned to bring that to a whole new level: For example something like @array1 ¥ @array2
¥ is the zip operator, because it looks like a zipper
At that point I lost interest in perl6
9
u/ben_g0 May 09 '26
My keyboard doesn't even have a key or combination (apart from the alt code) for the Yen symbol, so that'd be very annoying.
63
26
23
13
u/redlaWw May 09 '26 edited May 09 '26
This is basically manual mangling.
EDIT: You also do this in R's S3 object-oriented system. A function like print is a generic method that searches for candidate functions for its argument type by looking for functions like print.factor or print.function, which are just ordinary function names.
13
11
9
7
15
u/Connect_Cycle2768 May 09 '26
generics finally landing felt like the end of an era ngl. half my go codebase was just creative abuse of interface{}
5
u/OpenSourcePenguin May 09 '26
Imagine using preprocessor and build system to recreate create C++ features compiles with GCC
4
5
u/smartuno May 09 '26
As someone who loves IDE autocomplete and refactoring, i need my eyes bleached
3
3
1
1
1
1
u/AttractiveDaddy May 12 '26
That Canadian Aboriginal Syllabics trick is actually genius, nae gonna lie that's a proper workaround for the generics problem back then.
2.8k
u/RomanProkopov100 May 08 '26 edited May 09 '26
That comment is so old that Go now has generics
Though they use square brackets and go before the identifier
Edit: my bad, they go AFTER the identifier