DEV Community

Cover image for Why I dislike Go
Matronator
Matronator

Posted on • Updated on • Originally published at linkedin.com

Why I dislike Go

Update March 2024 - Since this article was written, I have worked a bit more with Go and found to actually enjoy the language despite my initial dislike of some of its quirks mentioned here.


As a programmer, I have worked with many programming languages over the years, and I have to say that Go (or golang) is probably one of my least favorite. In this article, I'll explain some of the reasons why I dislike Go, based on my own experience.

Syntax

One of the most significant issues I have with Go is its syntax. While it may appear simple at first, it can be unintuitive and confusing. The way it handles errors and null values can be frustrating, and the use of the := operator for variable declaration can be hard to read, especially for those coming from other programming languages. Additionally, Go lacks some essential features that are available in other modern programming languages.

Lack of Object-Oriented Features

Go's lack of proper object-oriented features is another significant issue that I have with the language. While it does use structs and interfaces to implement object-oriented concepts, it doesn't have traditional class hierarchies, which makes it challenging to write code that adheres to traditional object-oriented principles. The lack of classes and ability to extend them makes the language really hard to work with on more complex projects. This can be frustrating for developers who are used to working with other programming languages that have more robust object-oriented support.

Difficulty writing Object-Oriented code

In addition, Go's approach to object-oriented programming can make it difficult to write expressive and reusable code. For example, it doesn't support inheritance, which limits the ability to reuse code and create class hierarchies. Furthermore, it doesn't have method overloading or default parameter values, which makes it challenging to write reusable code..

Error handling and no exceptions

Source: https://knowyourmeme.com/photos/1167690-oh-no-its-retarded

Another issue with Go is its error handling and lack of exceptions. While it's good that Go encourages checking errors, the way it handles it is a disaster. Instead of using exceptions like almost every other modern language, they went for checking errors with if conditions... This can make it difficult to handle errors gracefully and leads to (a lot) more code clutter. I would like Go much more if they added regular exceptions like any normal language, but I don't see that happening.

Source: https://mkfeuhrer.medium.com/handle-errors-the-right-way-golang-9d9fb3ea687e

Organizing project

Go's project organization is another area that I find frustrating. There's no standard way (that I know of) of organizing your project files. Every third-party library I checked has a different approach. This can make the project a mess and hard to navigate, especially for larger projects.

Aesthetics and lack of features

Finally, I find the Go programming language to be aesthetically unappealing to put it mildly. Its naming conventions and package organization can be inconsistent and confusing, leading to frustration. Moreover, it lacks some of the elegant and expressive features found in other modern languages, making it feel cumbersome to use. Actually it lacks most of the features from other languages and the feature set it has is very limited (there's only one looping mechanism, no generics, no ternary operator, no default values for parameters, no function overloading, etc...).

All about the looks...

It's not all bad

I don't dislike everything about Go though. Some features are quite nice. Like multiple return values, easy concurrency, fast compile times, that it compiles to executable binaries on every platform and speed, performance and small file size of the compiled programs.

In conclusion, while Go has its strengths, such as its built-in concurrency features and its focus on simplicity and performance, it's not a language that I enjoy working with. Go's syntax, lack of proper object-oriented features, difficulty in writing expressive and reusable code, error handling and lack of exceptions, messy project organization, and ugly syntax make it challenging for me to work with. Nonetheless, the choice of programming language ultimately depends on the specific needs of the project and the preferences of the developer.


Be sure to check out my latest project MTRGen - a PHP file generator.

Visit my portfolio if you want to see more projects like this and more.

Top comments (0)