Re:Why people in Google hate Go?
by guntherhermann on Friday November 03, 2023 @06:51AM
(#38126832)
Can you give an example of 'shitty code'? We've got murmurs of Go being adopted by some teams so if you have first hand experience it'd be really useful
[ Parent
| on HN ]
As a counter anecdote, I've worked at two large companies with monsterous Go codebases and they are totally fine to maintain. There is no justification to the claim that Java repos are "easier to maintain" by the above commenter, as we have decade-old Go codebases that doing great.
I'm just as fast/productive in Go (8 years of experience) as I am in Python (13 years of experience), but the resulting code is:
* more maintainable (enforced typing vs typehints+mypy)
* faster (compiled vs interpreted)
* consistently structured / opinionated (until recently we didn't have generics, which meant that engineers often had to do things the "boring and verbose way" instead of the "clever and concise way" which, though frustrating short-term, has proven to be much better for maintainability long-term.
There's no reason that your company can't support multiple languages. Uber has large Go monorepos, Java monorepos, Python monorepos, etc. and they all work in harmony and with different requirements.
Re:Why people in Google hate Go?
by madeofpalk on Friday November 03, 2023 @06:58AM
(#38126886)
Single letter variables. A terrible pattern the go community picks up.
I've heard that this is the result of snake-case refugees from C, Python etc. Single letter variables are camel and snake, everyone's happy.
Eh. Yes and no. I have not worked on a team that enforces that and I do agree with using them for short functions with 1 or 2 types. I do this in python as well
with open(..) as f:I have never seen this done in enterprise Go code, and I don't think it's been strongly recommended since the mid 2010's?
For small functions where you can see everything in a single page, this is fine. Though I think they should always be avoided except the most common cases (`i` for index) because keeping a codebase grep-able is a high priority. Using constant, verbose variable names can make tracing through a codebase much easier.
My guess is that he means, he would prefer variables to be more descriptive. Easier to read and follow.
Single letter variables like `i`, `j`? How `index1`, `index2` is any better?