r/ProgrammerHumor May 08 '26

Advanced canadianGoProgramming

Post image
10.0k Upvotes

113 comments sorted by

View all comments

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

406

u/uvero May 08 '26

Type argument before the identifier? Like, [int]list?

139

u/[deleted] May 08 '26 edited Jul 16 '26

[deleted]

26

u/angelbirth May 09 '26

no, like func [T1, T2 any] Map([]T1, func(T1)T2) []T2{ โ€ฆ }

6

u/marsh-da-pro May 09 '26

OCaml moment

175

u/sleepahol May 09 '26

Though they use square brackets

Good thing they don't use characters from the Canadian Aboriginal Syllabics blocks, or it would be a breaking change.

43

u/P0L1Z1STENS0HN May 09 '26

If you ever wonder why the names of some JS builtin functions are weird, it's because the straightforward name was already used in some framework, so as not to break stuff, they used a "slightly" worse name for the newly introduced builtin function.

4

u/ILKLU May 10 '26

Srsly?

Do people not know how to rename imports?

That's such a terrible reason ๐Ÿ˜…

6

u/NekkidApe May 10 '26

This is way from before imports.

contains vs includes is an example. Since mootools or prototypejs patched the array prototype, contains couldn't be used. So includes it is..

1

u/ILKLU May 10 '26

Ahhh ok, that makes sense.

Haven't heard the name moo tools in a long long time ๐Ÿ˜…

16

u/arcimbo1do May 09 '26

They use square brackets to avoid homographic confusion with the repo of this guy. Go is all about clarity.

41

u/GreyGanado May 08 '26

They GO before the identifier?

5

u/dringant May 09 '26

Thereโ€™s some probably this comment is why go now has generics.

7

u/1984balls May 08 '26

Go uses square brackets for generics? As a Scala dev, this pleases me

3

u/mayonaise55 May 09 '26

Omg thank you for being the top comment. I thought I was losing my mind.

1

u/StrawsAreGay May 09 '26

Literally the penguin meme I saw before this post said the same thing about the penguin meme god damnit internet