Samy's blog

My experience with the Go programming language as a Javascript developer

Lately, I have been playing around with the Go programming language; in this post, I'm going to point out some things that I like and dislike about the language so far.

What I like so far

  1. Concurrency and async I/O management.

    Go handles these exceptionally well, thanks to goroutines and cooperative multitasking. No event loops, no heavy threads, no async/await, no system-queue APIs, just simple blocking code that’s non-blocking and concurrent by default.

    Go was designed with concurrency in mind and it shows.

  2. Compiled binaries.

Is easy to compile binaries for most relevant platforms and architectures without much hassle, with no need for a virtual machine or runtime installed on the target machine.

  1. Is a minimalistic language.

    Go is easy to read and maintain, without a lot of legacy baggage behind it, its transparent on most of the things it does and how it works, which reduces the cognitive load when it comes to writing and reading code.

  2. Has a low memory footprint.

    Go is not very memory hungry (of course this can also depend on how optimized the code is ), so far what I have found is that the binaries it creates run low on memory, this can help reduce cost on cloud services like AWS.

  3. Is newbie-friendly.

    Due to low cognitive load and minimalistic design, I think it is the right language for beginners to grasp, it reminds me a bit of python when it comes to getting up and running, this makes it easier to onboard people on the team.

  4. Good set of build-in tooling.

    Go comes with a set of built-in tools which includes a benchmarking tool, a code linter, and a testing tool, this can help significantly with consistency across many different projects without needing anything external, this reduces complexity when working with multiple projects.

What I don't like so far

  1. Pointers.

    I find it odd that the Go team decided to add pointers to the language, I guess the choice to include pointers was for performance reasons, they are safe to use in Go compared to C/C++, but are still breeders of confusion in my opinion.

  2. There are not many ways of dealing with collections of data.

    There are not many ways to deal with collections, I miss things like map, reduce and forEach which can help a lot in reducing the amount of code, you can build your own on Go, but it gets tedious after a while.

  3. Not a lot of community libraries around.

    Go is still a bit new on the game, so the library's ecosystem it's still a bit green.

  4. Dependency management is still lacking.

    As of the time of this writing the module system for Go it's still somewhat raw, so there's no easy way to type command and get your dependencies downloaded for a project, this can be problematic when sharing code publicly, luckily they are Working on it.

Conclusion

So far I like plenty of things about Go, it's easy to compile small binaries and deploy them on multiple platforms.

It's easy to understand, and its concurrency management is excellent, even with its faults like the lack of libraries and collection constructs.

I highly recommend anyone bored with its current language to give it a try and experiment, if you want to get started with Go I recommend this quick and easy to follow tutorial, which is beginner-friendly for both experienced programmers and newbies alike.

ko-fi

- 1 toast