News for hackers. Stuff that matters.
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.
Re:Why people in Google hate Go? by jjgreen on Friday November 03, 2023 @07:35AM (#38127220)
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.
Re:Why people in Google hate Go? by leetrout on Friday November 03, 2023 @07:04AM (#38126943)
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:
Re:Why people in Google hate Go? by carb on Friday November 03, 2023 @07:10AM (#38127014)
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.

Re:Why people in Google hate Go? by cultavix on Friday November 03, 2023 @07:02AM (#38126924)
My guess is that he means, he would prefer variables to be more descriptive. Easier to read and follow.
Re:Why people in Google hate Go? by favadi on Friday November 03, 2023 @07:00AM (#38126911)
Single letter variables like `i`, `j`? How `index1`, `index2` is any better?
Re:Why people in Google hate Go? by lm28469 on Friday November 03, 2023 @07:18AM (#38127084)
Is that really the best argument against Go lmao ?