Short Variable Names in Go

When I first started learning Go, I heard a lot of people talk about the idiomatic way of doing things. “Sure, that way works, but this is the way we do it in Go.” I’m OK with that - a strict convention can give every piece of code a strong sense of familiarity - and Go has quite a few of these. One such convention is to use short variable names. Variable names in Go should be short rather than long. This is especially true for local variables with limited scope. Prefer c to lineCount. Prefer i to sliceIndex. ...

24 May, 2020