Skip to content

Instantly share code, notes, and snippets.

@timkendall
Created December 26, 2017 18:23
Show Gist options
  • Save timkendall/f40f1aeabe1eecd44014ed9b65122103 to your computer and use it in GitHub Desktop.
Save timkendall/f40f1aeabe1eecd44014ed9b65122103 to your computer and use it in GitHub Desktop.

Here are some of my initial thoughts on Go (a very popular language right now). Still need to spend some time actually developing non-trivial applications with it.

Thoughts on Go

Likes

  • Simple, small, stable syntax
  • Strongly typed, compiled
  • Awesome, modern concurrency + parrallelism
  • No classes
  • Interfaces
  • Exports by convention (i.e functions starting with capital letters)
  • First-class functions with defer statements (i.e run stuff after function exits
  • Unique approach to declaring methods on custom types
  • Packages, encourages separation of concerns and thinking of application parts as "microservices"

Dislikes

  • Community philosophy around packages (i.e want you to copy/paste)
  • No good package manager/ecosystem (i.e just have to install from GitHub repo and hope the authors don't take it down or changes stuff)
  • No pattern matching
  • Documentation for 3rd-party libraries is usually ugly and bad
  • Seems like style is very procedural
  • Ugly string interpolation
  • No immutability
  • Channel creation is kinda clumsy
  • "Moving from Ruby to Go sometimes feels like ignoring 20 years of progress made in language design"

Undecided

  • No exceptions, forced to handle errors immediately
    • Leads to very procedural code
  • No generics
@tj
Copy link

tj commented Dec 26, 2017

It's dumb and simple by-design :D Ruby was pure madness when I worked with it. Go takes some getting used to, but it grows on you, super explicit.

Regarding package management dep is likely to become the "standard", but just like Semver in any other, locking exact versions is the only safe thing to do (I've been bit by loose semver even from internal implementation details).

The explicit error handling is something that I think most people learn to love as well, error boundaries shouldn't be ignored, in some classes of programs maybe that is appropriate (frontend perhaps), but I can't think of many where that's a reasonable approach.

@timkendall
Copy link
Author

Yep - I feel the same about Ruby. Full OO gets nuts unless you have static typing (Crystal is pretty nice) IMO.

@timkendall
Copy link
Author

Should also note how much I like it being primarily focused on just types + functions 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment