this post was submitted on 02 Feb 2024
22 points (100.0% liked)
Programmer Humor
32461 readers
737 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Go is like snakes in that some divine creator decided that unlike all the other animals, you don't need legs, because legs are hard to make and they keep you down anyway. You can do everything legged creatures can do just fine by bending and twisting in the right ways, and anyone who suggests legs could be useful is a fool who doesn't understand what they're talking about. Sometimes, after the complains of many snakes, the creator buckles and gives you the ability to grow legs, which are still completely useless despite all of the noise and the decision not to include legs has always been the right one.
Like many snakes, Go also has some incorrect beliefs about how windows are supposed work, but like all other facets in life, they can squirm up against them as if there are no windows to worry about.
Amen. I couldn't have said it better.
Didn’t it only recently get generics? How was stuff even done before then?
interface {}
- which is the equivalent of C/C++'void *
.It got them back in 1.18. Not every project and library has upgraded to that yet but at least modern tools have generics.
Things were done the Go way, with specific implementations. You had maps, slices, and arrays, and those were all the generics in the language. Supplement the lack of generics by stuffing functions using generics into interfaces and then implementing those interfaces for every type you need to call the function on.