So Far in Go
I have been writing Go for about a year now. For the most part, it is a wonderful language. For some context, before I started using Go, I used two languages primarily: Ruby and Java. Java was for work and school (the “professional” stuff), Ruby was for personal stuff. It’s hard not to start comparing languages, so I’m going to do that with the two languages with which I consider myself most familiar.
Comparing Go to Java, Go is a godsend. It is a relief going from wiring up a FeatureDelegateInterface for a new feature, then a DelegateFactory to produce FeatureDelegateImpl and FeatureDelegateTestImpl that use a FeatureDao and finally all get wired up into a Spring Boot controller somewhere (and before you say “you don’t have to do that in Java!", just know this is Enterprise Java™ where you very much have to do that to ensure you have a robust, production-ready application). Java is so…heavy when you get to more than just toy applications. Its inheritance focus can also lead to some spooky behavior. You can do dependency injection with Java, but look at Go - dependency injection is just how you couple parts of your code. Go doesn’t quite have inheritance - sure, you can embed structs, but that’s a poor approximation. And Go’s interfaces aren’t quite the same as Java’s. You still declare functions/methods and their signatures, but then that’s it in Go. Interfaces are implicitly inherited in Go instead of explicitly. This is something I’m still not sure that I like - I personally prefer being explicit over MAGIC! (which coincidentally is why I like Go’s idea of errors).
Comparing Go to Ruby, I enjoy the performance of Go.
Not just execution - compilation as well.
Spending time in other compiled languages (I’ve dabbled in C#, C++ and Swift on top of Java), I had become used to waiting for a minute or two as my program compiled and started up.
Go’s compilation time is a snap comparatively.
I also find great joy in the
go run command, it provides an experience similar to interpreted languages.
I also find Go’s syntax incredibly expressive; closures are one thing that translates from Ruby very well in particular.
It’s odd to bring up when comparing Go to Ruby, but Go’s channels and goroutines feel very Ruby-like in their simplicity.
Multi-threading was always a pain point in other languages - both in implementation and in comprehending what you wrote upon returning to it.
But Go takes a lot of that away and makes it much easier to comprehend parallel code as you are reading it.
These are just a few things I’ve noticed in my switch to using Go full-time. Overall it is an incredibly fun language to work with, and it offers many things to increase productivity. It has downsides, but for me and the work I’m doing, there isn’t a language I’d rather use than Go. Of its downsides, the only one I notice is the lack of generics - which honestly doesn’t cause me a ton of pain. It can lead to code duplication, but I’ve come to enjoy having specific implementations for things over more abstract, generic implementations. So there it is: Go. A perfectly decent language that I greatly enjoy using.