1 of 9

Why do I Use Go?

Ed Crewe

��Developer on EDB’s Postgres AI Cloud Marketplace Product

+

=

+

=

2 of 9

Why do Critics RANT against GO?

Like any language Go has its critics, it is good to check out what features idioms and patterns are seen as an issue. To understand and answer them with respect to your own usage of Go.

The highest profile anti-Go rant I Googled is:

Lies we tell ourselves to keep using Golang

Plus developers verbal complains / Reddit rants. Lets address a few of the wider criticisms from this blog post first, then dig into the language …

3 of 9

Mom smokes, so it is probably OK

Primary criticism: People adopt Go just because�it is in use by large companies for significant products. �Management think it must be a sensible choice, without fully technically assessing it.

In this case I would have to say the author may not be a platypus, but his use case, is the oddest Go creature I have come across!��As a Windows system language for integrating into C and C++ … which leads on to his ‘Go is an island’ criticism. �The Go language does not use standard assembly and C compilers that enable easy Foreign Function Interfaces, where as Node, Python and Ruby are all more suited to FFI. ��A standard Go cross language integration I use is via gRPC. But that is cross-system not low level, so not suited to the author’s use case.

4 of 9

Smoke forms a Cloud

Wrong tool - Go for low level Windows ~ Like C# for Cloud Tooling. ��Generic languages DO NOT suit all use cases, else why do so many exist. �Use the right tool for the job.�

THE CLOUD: Docker, K8s, Terraform/Tofu, Pulumi, Rancher, Flux, Argo, Prometheus, Grafana, Istio etc, whichever CSP, all of it Go.�They will expose Java, Python APIs, but to dig deeper than a template generated solution for k8s you need to use kubebuilder in Go. Or code a full Terraform module, it must be Go.

5 of 9

Go is Simple = Good for ProtoTyping =

A core quality is Go is simple, and simple provides RAD, the reason for prototyping.�

The author argues that prototyping is a lie and the code ends up staying in production.

I would argue that if it is deployable and deployed to production then it is by definition not being used as a prototyping language. His argument is about failing to use a prototyping language … so is nothing to do with Go.

If prototyping is required, is that language close enough to Go and difficult enough to deploy to, to make proper prototyping .. and doing it in Go, worthwhile. A common case is hard wired embedded C.�� This is again about properly defining the job, to pick the best tools for it.��On the plus side, the top rant post against Go on the web also cites 3 other features they like …

6 of 9

The Gold Star Language Features

The features nobody can deny Go beats other compiled languages at:

  1. Simplicity�For a performant compiled language, otherwise Python tends to compete here.�
  2. Asynchronous coding is in the core and is elegantBut for cloud, of little use, since each microservice should ideally be a single process per container. I only use goroutines for cron jobs which could be k8s jobs. My primary use is fast parallel tests.
  3. Core Tooling is extensive and easy to use�- eg. dumping goroutine stack traces using “runtime/debug”�- tests run concurrently by default etc.�
  4. Fast and small�Fast start, performant, with small binary and memory footprint - perfect for a microservice

7 of 9

Java wingers - Reddit Rant (my turn to rant about java!)

  1. Lacks Proper Dependency Injection
  2. Lacks Proper Package management (ie. no Maven)
  3. Domain names in packages
  4. Lack of big stack traces
  5. It not more performant than Java
  6. Its difficult to maintain for large monolithic applications

8 of 9

“Why hasn’t it Got ______ “ wingers

  • No function overloading
  • Standard library isn’t extensive enough
  • Lack of generics
  • No Sum types (only just added to Java so more a Kotlin / Rust winger)
  • No immutable types (Java / Python winge)

9 of 9

Real issues? … discuss or even RANT!

  1. Error handling embedded in functional code
  2. Explicit passing by value or by pointer is less obvious to use than immutable types + use of nil + cases of no warning of uninitialized variables by the compiler�-> null pointer exceptions all day long (nil pointer dereference errors)
  3. Multivalue Assignment hides already instantiated values�-> lost assignment so empty variable �ie errors of new same named temporary scoped variable having value
  4. Not proper OOP … instead structs use�- Interfaces only implementable via implicit duck typing�- Type embedding - and its own complexities - rather than inheritance