You won't find hundreds of purported simple/easy things that are exclusive to Go code.
There's probably less than 10 cases where I implemented some simple thing (like a set of strings) that Java gave for free because of library function that used generics.
Among 50k loc that's background noise.
from README:
// ... use session session.Close()
can be changed to this right after you get a session:
defer session.Close()
This is precisely how I feel, could never capture it in words myself.
Sounds like JavaScript/Node all over again, which shouldn't surprise anybody as many of the prominent Node developers hopped over to Go.
a = append(a, el)
pop: n := len(a)
el := a[n-1]
a = a[:n-1]
It took me, literally, 10 seconds to write.I looked it up and it's not but the point is that you shouldn't have to worry about these things, including implementation details of trees and hundreds of other data structures.
I don’t think I will ever understand why so many go advocates seem so openly hostile to encapsulation. If go had used C-style for loops, I swear there would be people here defending the decision saying:
sum := 0
for (i := 0; i <= len(a); i++) {
sum = sum + a[1]
}
“See? Only four lines. What’s the big deal? It took me literally thirty seconds to write.”Compared to
array.sum()
was the above code more or less clear? Is it more or less prone to bugs? When reading, which code will you have a quicker understanding of the intent?And if you did notice the the first bug, did you notice the second bug?