I'm not sure now which sections are and aren't.
I'm not sure now which sections are and aren't.
It might just be my sense of humour (I'm the sort of person that doesn't need an '/s' tag and feels that it shouldn't be necessary if you told the joke properly), but it was pretty obvious to me even without the irony warning that the page was intended as a joke.
It looks like it was heavily inspired by the classic 'Tao of Programming' [0]. It uses a very similar style and even quotes the actual Tao Te Ching.
Oh and a second thought on /s. For some time I only got my news through satire sites like the onion. And after I switched back to "real news" sites, I could not believe it was not satire. I mean come on, the world and the internet was always full of dumb people, but when even very high ranking people and institution say really out of the world things in all seriousness - I came to the conclusion, marking irony as irony is sadly sometimes important, in those interesting times we live ...
But this new level is a bit unsettling.
Golang's landscape is full of one letter variables and abbreviations and it's not great.
Stuff that isn't easily understood should be named appropriately but shortness is encouraged.
If you're storing an index in a global variable or a struct field then it should be called "index" not "i".
Method receivers are usually always kept short because they're pretty self explanatory and the first thing you look at in a function.
I did browse the go code randomly and for example t, s, and b are terrible variable names in my opinion in this example : https://github.com/golang/go/blob/3ce865d7a0b88714cc433454ae...
You can find a lot of code like this.
But even if these names were not available, I don't think using `tpl` or `t` or `b` is what should be preferred.
All three are “the template”. So, they use polish-ish notation: the template as []byte, template as string, and template as *template.Template.
I use Go a lot, so I’m used to it’s conventions. b for bytes is obvious to me because I know ReadFile returns bytes (not a file handle or a buffer), but I can see why if you lack context, it can look odd. OTOH, I don’t use Rust, so when I read snippets with 'a lifetimes, they always look “wrong” to me.
fooBarBazThings.each(t => t.DoThing())
for (int i = 0; i < len(things); i++) { // i used here }
Some local code patterns are seen so often you understand it in one go. Something like fooBarBazThings.each(fooBarBazThing => fooBarBazThing.DoThing())
for (int thingIndex = 0; thingIndex < lengthOfThings; thingIndex += 1) { // thingIndex used here }
Just clutters things up. fooBarBazThings.each(thing => thing.DoThing())
It's more useful when the receiver of the method doesn't tell you as much, eg: getRecentPurchases().values().forEach(price -> priceStats.accept(price));