For every fave this tweet gets, I will give you one #golang fun fact
-
-
Fact #2: -128/-1=-128 in
#golang, but only sometimes.Show this thread -
Fact #3: identifiers are only exported if they’re part of the Unicode uppercase class, which makes Unicode support basically irrelevant.
Show this thread -
Fact #4: go doesn’t have a ‘xor’ operator for Boolean values, but it DOES have a ‘xor’ operator for... integers.
Show this thread -
Fact #5: go functions can return multiple values, kind of like tuples except 40 times harder to work with.
Show this thread -
Fact #6: in go, integer division is a Euclidean domain, except when the dividend is nonnegative and the divisor is a constant power of two.
Show this thread -
Fact #7: Since go requires alphabetized package imports, ‘go fmt’ is sort of part of the build system.
Show this thread -
Fact #8: integer overflows aren’t actually an error in go, but only when they arise from +,-,*, or <<
Show this thread -
Fact #9: instead of algebras sum types, go has iotas in constant declarations, which are kind of just worse in every feasible way.
Show this thread -
-
Fact #11: go’s error handling has been compared to shoving spaghetti up your nose with a salad fork.
Show this thread -
Fact #12: numeric constants are not allowed to overflow; you can’t put ‘NaN’ in your code unless it’s at runtime and sufficiently unexpected
Show this thread -
Fact #13: for some reason, “runes” (literally just Unicode code points) are considered numeric constants too. God fucking knows why.
Show this thread -
Fact #14: much like Haskell, go makes the mistake of treating code points as units of text. Unlike Haskell, it wasn’t created in 1998.
Show this thread -
Fact #15: if you try to implement a library for recursion schemes in go, rob pike will burn your house down.
Show this thread -
Fact #16:
#golang has its own version of Goto statements, which means someone thought about this for more than two seconds AND STILL DID ITShow this thread -
Fact #17: Go’s package management is basically “github lol”, because apparently code points are numbers but versions aren’t.
Show this thread -
Fact #18: if you change your github username, you break every package that depended on one of your packages (extra transition milestone!)
Show this thread -
#19: channels are one of the better parts of
#go, but debugging concurrent code for is about as fun as the theater when your name is AbrahamShow this thread -
Fact 20:
#golang is popular for web, probably because http was too easy and developers needed to worry about when dividing by two would workShow this thread -
#21: Rob pike is kind of like Jesus, if Jesus gave hungry people a programming language wisely crafted for their little poor person brains.
Show this thread -
Fact #22: go, supremely elegant from its simplicity, kindly gives you a ‘&^=‘ operator.
Show this thread -
-
-
#25: during package initialization, the compiler doesn’t do real dependency analysis and instead pretends some orgy of strings is a solution
Show this thread -
Fact #26: go depends on satan when computing arctangents https://golang.org/src/math/atan.go …
Show this thread -
Fact #27: go, in its infinite simplicity, kindly provides you with an isNaN() function, since ‘== NaN’ is too clear to be considered valid.
Show this thread -
Fact #28:
#golang’s math library has a function called J0, deftly designed to never be inscrutable to anyone who might steal you physics hw.Show this thread -
Fact #29: you can’t do Peano arithmetic on types in
#golang, despite the fact that apparently ‘﷽’ is a numeric constant.Show this thread -
Fact #30: Rob Pike invented static binaries, because dynamic linking was too fast and CPUs needed a rest.
Show this thread -
#31: if you’re tired of pl theory, try pl practice!! Go compiles to its own version of assembly and calls a bespoke assembler (2nd compiler)
Show this thread - 19 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.