Why I like Go
Recently I have been using the programming language Go for most of my personal projects. It is my current favoured language.
I have gone through a number of languages to get to this point. For a long time I have been on the lookout for a language that meets my personal requirements.
My goal is to have a language I can use for most projects and become proficient in. While I know and use multiple languages I like to have one that I reach to by default. I like to become proficient with one language and its tooling.
Some of my personal requirements
- Simple
- Easy and understandable deployment
- Community support
- Free/libre
- Easy to use for websites and CLI programs
- Easy to use concurrency
My progression through languages for this purpose
- Tcl
- Perl
- PHP (for websites)
- JavaScript (Node.js)
Other languages I considered
- Haskell
- Erlang
- Ruby
- Python
- Rust
- C
- C++
I had comments on why I like and dislike each of these languages but I can't do them justice without making this list huge.
Why I like Go
This list is in roughly descending order of the importance I place on each.
- Simple
- It is a small language. Understandable. Garbage collected. Instead of feature bloat the language is intentionally kept small.
- Enforces good practices
- For example you can't include libraries you don't use, and you can't declare variables you don't use. Your code won't compile. This is a big focus of the language.
- Concurrency
- Support is built into the language and is easy to use (channels, goroutines).
- Compiles to a single executable
- Deployment is simple. I don't have to worry about what versions and libraries are going to be used so much.
- Excellent base libraries
- For example standard library includes HTTP requesting/serving, cryptography functionality, and JSON decoding/encoding. Functionality that is often key these days.
- Excellent Unicode support
- There is little ambiguity about what type of data you are working with. Primitive types distinguish between bytes, runes, and strings.
- Speed
- You can go to production with it and scale up. It is not like Ruby for example where I might have to rewrite to meet requirements.
- Easy to call out to C directly
- Standard library and tooling makes this very easy to do.
- Useful documentation
- Standard these days but the Go documentation is quite useful and concise.
- C like
- It is not a big jump from C to Go. As opposed to if I were to propose switching to Lisp to someone for example.
Summary
Not that I would call the language perfect, but it is the one that best meets my needs right now. The biggest positive about the language is the emphasis on simplicity and simple practices. The acknowledgement that writing software is difficult enough and cleverness and complexity need to be guarded against.