From bd112e16b73569993413b8f768c3849e74b53dfd Mon Sep 17 00:00:00 2001 From: Hugo Fonseca <1098293+fonsecas72@users.noreply.github.com> Date: Wed, 6 May 2020 23:28:32 +0100 Subject: [PATCH] Revert 19fec6dcbba6fadcee2fd646d345ad5a911f96ec...59555a7a977fa183142a1fbc23222d61b58d165d on CodeReviewComments --- CodeReviewComments.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CodeReviewComments.md b/CodeReviewComments.md index cf2329e9..680b6116 100644 --- a/CodeReviewComments.md +++ b/CodeReviewComments.md @@ -598,8 +598,6 @@ In any case, the onus is on you to fail with a helpful message to whoever's debu ## Variable Names -Variable names in Go should be clear and descriptive rather than short. Exceptions can be made especially for local variables with limited scope or general conventions (e.g. coordinates: x y z; loops: i j k). +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`. -Prefer `lineCount` to `c`. Prefer `sliceIndex` to `i`. Prefer `message` to `m`. Prefer `test` to `t` - -The basic rule: avoid single letters variables \ No newline at end of file +The basic rule: the further from its declaration that a name is used, the more descriptive the name must be. For a method receiver, one or two letters is sufficient. Common variables such as loop indices and readers can be a single letter (`i`, `r`). More unusual things and global variables need more descriptive names. \ No newline at end of file