Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is filled with common sense (follow a style guide) and subjectively wrong advice (clear naming). In Go, it is expected to keep locally used variable names short to improve comprehension and the more global the variable the more explicit it becomes. For example, a for loop using the variable i instead of writing out “index”. Writing out the word arguably makes the code harder to comprehend because there is more noise around unimportant details like the name of the index variable in the loop.

I am surprised this got upvoted.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: