18/01/2025
My First Impression On Golang
Reading Time: 2 minute
I am a JS/TS developer and I wanted to gain some experience in Golang. So, I read the documentation and unfortunately, my first impression was a little bit complicated. At the first look; Go seems to me it has some pros and cons compared to other languages, especially compared to TypeScript and Rust. Here they are:
Go is great because it’s easy to write in, performs well, and has almost no learning curve for a JavaScript developer. It’s a big deal that it provides excellent performance while maintaining simplicity and ease of use. Compared to Rust; Rust is a much faster and more powerful language, but its learning curve is significantly higher, and it’s not as easy to write in Rust as it is in Go. Go is a better option for many projects, if a project doesn’t need to be highly scalable and therefore no need to write in Rust. Compared to JavaScript, Go has much more performance. So in my opinion, Go stands in the middle between JavaScript and Rust.
Go is not as complicated as Rust and is as easy to write in as JavaScript. But even so, Go's syntax is not as clear as JavaScript's and Rust's. There are no iterators like "some", "every", "map", "filter" in Go and it provides only one looping method: "for". This might seem like it's a good example of the simplicity of a language, but I disagree.
These kinds of iterators are beneficial for the readability. I don't need to figure out what's going on in a looping and what the "for" keyword is doing in somewhere exactly, thanks to the iterators of JavaScript. The lack of iterators in Go makes the readability of code quite bad in my opinion. Doing everything with only one iterator is not a good practice for clear code. However, in JavaScript, it's much easier to understand what's going on in an iteration unlike Go. This is definitely a BIG disadvantage for me.