1. 6
  1.  

  2. 4

    Short identifiers: A lot of Go code, including the snippets in the documentation, is plagued by extremely short identifiers. Those are used as local variables, function arguments, method receivers, and even structure members. Combined with the heavy use of interfaces, it is hard to read the code: What’s a c? And an r? And an s.wg? Yes, there is bad code all around, but when the official language documentation seems to recommend this approach, you can expect that others will follow the apparent recommendation in all cases.

    I also don’t get their obsession with using very short names. Also the use of very common short names for the default packages is annoying as it pollutes the namespace. Things like “user”, “url”, “bytes” are package names, which means they can’t be used as variable names. So instead of writing something clean like user := user.Current() one has to write something like u := user.Current(). I know it’s possible to use aliases for the package names but it’s not an ideal solution. By default, common names shouldn’t be reserved like that.

    1. 3

      Also the use of very common short names for the default packages is annoying as it pollutes the namespace. Things like “user”, “url”, “bytes” are package names, which means they can’t be used as variable names.

      IMO “user” is a bad variable name - “current_logged_in_user” or “authenticated_user” sure. the only time I think user is good as a variable on its own would be when you’re doing a loop over a list of users, or working in a tightly scoped function, and in either of those cases u seems just as good to me.

      But I think my fundamental objection to your argument: what should the package that works with bytes be called if not bytes?!

    2. [Comment removed by author]

      1. 4

        https://github.com/Microsoft/vscode but don’t look it’s Javascript & Typescript.

        Finding algo:

        1. ctrl-f vscode
        2. click first link - https://code.visualstudio.com/
        3. click the amount of stars link in the menu - https://github.com/Microsoft/vscode/stargazers
        4. change url to https://github.com/Microsoft/vscode
        5. profit?
        1. [Comment removed by author]

          1. 2

            You have to advertise to the target audience. Rockstars have expectations :P

            1. 1

              There’s actually a “GitHub project” button on the mobile version of the website that goes directly to the Microsoft/vscode repo: https://i.imgur.com/Fo3W90O.png

              Don’t know why it’s absent on the desktop site.

              1. 1

                It’s enough to click the “Star” button (it doesn’t do anything except link to the GitHub page); definitely not obvious!