Engineering

Why I Chose GoLang

I started using Go at the beginning of the year. It didn’t take me long to start enjoying the language, and become productive with it. Since then, I have not written a line of Python, which was my main language before that.

A Bit of Background

To give you a bit of background, I started programming with PHP, Python, and JavaScript. I was mostly focused on Web development. Over time, I began rethinking my tech stack, searching for tools that better aligned with my evolving goals. This is when Go caught my attention.

I still wanted to write for the Web, without having to deal with the JavaScript/TypeScript ecosystem on a daily basis. Learning Go was an excellent choice for anything backend-related. Go is a C-like language with a garbage collector, a limited syntax, and a complete and well-written standard library. This combination makes the language both performant and pleasant to write.

Simplifying My Stack

The goal behind this transition was to simplify my stack. Anything backend-related will be written with Go, and maybe some Python. Based on the complexity required, the frontend could either be simple HTMX application with some sprinkles of vanilla JavaScript, or a full React application. I know that this level of engineering is still not as simple as starting a new Django project or a full Next.js application, but I like the level of control and granularity it gives me.

Why Go Works For Me

To be honest, the performance of the language is not my priority. If you are building some side-project, you are unlikely to have enough users to make performance a real issue in the short term. When it becomes an issue, you can always rewrite your application or find some other solutions to scale at fair cost. However, I also work as a freelancer. The market in Europe is saturated with Java, PHP, and JavaScript. I wanted to find some niche that I would still enjoy, hence Go. The language is still relatively uncommon and many companies here are running on legacy code with no immediate plan to modernize. Java and PHP are still kings in that regard.

In itself, Go is not a revolutionary language, and neither a good nor bad one. It is designed to be performant, simple, and stable. These qualities are nice, but what truly hooked me was the overall feel of the language. If we are going to spend hours writing code each day, it should at least be fun (even a bit). I had some fun writing Python, but never when I was working with TypeScript. This pushed me to try to use Go as my language of choice for anything backend-related for several months this year.

Next year, I want to build more side projects and make them profitable. Learning a new language was not on my to-do list. Now, I need to move fast. Go is perfect for that. The language is simple (syntax-wise), breaking changes are rare, and the ability to embed everything in the binary makes deployment a breeze. Still, the language is not perfect (package management is wild) and has some limitations that might be a no-go for you. Personally, I love it.

A Balanced Perspective

It’s worth mentioning that your programming language doesn’t matter as much as some might claim on Twitter. You can build almost anything with (almost) any language. Everything will be based on your personal preferences and/or professional environment. Here, I am writing from the perspective of a one-person shop, with the specific goal of making a living from my side projects.

Unlike Python or JavaScript, the standard library in Go is amazing. It makes a lot of things easy and removes the need for a lot of dependencies. Not that dependencies are intrinsically bad, it’s just a cultural shift from the JavaScript ecosystem. I don’t often use Go’s concurrency model, but it is very well implemented into the language. I would really describe the language as neutral. It is neither bad, nor really good. This is not a bad thing, as it tends to avoid a lot of issues that could have appeared with more abstractions built-in and object-oriented languages. The same way Neovim made me better by removing a lot of escape hatches for doing the work, Go does the same. You have to be explicit about what you are doing.

My first impression of Go is that it could replace Java and Python on many levels. However, if you are looking for a language that would help you find a job, I would not pick Go. Unless you’re really experienced, the job market is pretty limited, at least in Europe. However, like I said, it makes expertise in Go a perfect niche if you can carve your space in the market.

Vincent

  • Published on 2024-12-01
  • 3 min. read

Tags