The Go effect after 7 years with Java

Recently, I’ve been working on some side projects to improve my Go skills. Since I have some close friends who are very active with Go, I was stoically observing their work along with the Go community. Hence, it was always an interesting topic for me. I don’t know when the exact time the spark is flamed but I found myself working on these side project after I came home from work till midnight. For a quick info, I’ve been working as a software engineer on a satellite ground station project. And I don’t have a single bit related to Go in my professional career. We use java, c++ and occasionally python.

So let’s return to the topic; the effect beneath Go. As far as I can see, Go is complicated at the begining if you have a solid java-style background. The language itself has a little awkward syntax. But in time, eventually, you are getting used to it. If I supposed to compare it with java, for a public function(method) you write;

1
2
3
public string getName() {
return this.name;
}

Go on the other hand;

1
2
3
func (m *MyStruct) GetName() string {
return m.name
}

As you can see, even with the simplest code snippets, with a java point of view, it is not so easy to get used to this syntax. But this is the initial feeling though. Also, lack of object-oriented paradigms such as inheritance etc. makes you look at the computer screen meaningless. So I thought that it would be a better practice to see other peoples work and try to understand how they use the the language in real life problems. I visited many open source Go projects and noticed that Go developers write code with the shortest possible variable names, shortest possible function names. Java devs on the other hand, tend to be more verbose. Java-like coding is like writing a literature book. Reading java code requires less learning curve. Go; hard to start easy to sustain. At the begining I was struggling to understand the code snippets but now I’m getting used to it. I’m sure that there are many writings about how Go has different syntax than X language or differences between functional programming and object-orinted programming. This comparison is a little out of my topic but still worth to mention a little.

My verdict on Go is that it is far more practical when it comes to create “something”. I mean, you have an idea, you want to see quick results without concerning code-style or any architectural things, Go gives you the oppurtinty to do your job swiftly. Not much boilerplates. Once you create the “thing”, you see that the program is actually fast, reliable and easy to distribute. You don’t need much effort to turn it into an actual product. I had an idea of making a Go client of tldr-pages. Altough there are plenty of same clients, I had a different idea to make it more and more user-friendly. It didn’t take more than 3 nights to create minimum viable product. When I published the pre-release version at third night, the repository had 9 commits and roughly 700 lines of code. It was nearly a ready product and when I showcased in some subreddits such as r/linux or r/golang it quickly took attention. It was very easy to create executable binaries via go build, so I wrote a bash script to create binaries for every mainstream platform and architecture. The script also compresses the files, runs a sha256 checksum and writes to a file. The script is also 40 lines of code. The project development was blazing fast, I had an idea and created a tool that is actually distributable and had positive feedback from the community. And I was not the pioneer of the idea of tldr-pages. Maybe the 50. client.

So what about the actual product? (tldr++) It is easily integrated to CI process, adopted from community and become a very user-friendly client. Also, performance-wise it is the fastest client. And offers much more functionality than others. The actual performance results are shown in the table below:

benchmarking Go C++ Rust bash node
tldr++ cpp-client tealdeer tldr node-client
time 5.273 ms 6.468 ms 11.59 ms 77.13 ms 415.9 ms
0.973 R² 0.937 R² 0.971 R² 0.815 R² 0.997 R²
mean 6.247 ms 5.889 ms 11.39 ms 59.26 ms 396.1 ms
std dev 1.203 ms 930.1 μs 1.170 ms 17.87 ms 15.89 ms
variance introduced by outliers 86% 78% 52% 81% 19%
app version v 0.3 v 1.3.0 v 1.1.0 - v 3.2.6
lines of code ~1.1K ~2.5K ~3K ~300 ~4.5K

bench v 1.0.12 is used for benchmarking and hardware details are: - cpu: Intel(R) Xeon(R) CPU E5-2637 v2 @ 3.50GHz, - ram: 128GB DDR3 RAM, - disk: SSD, 550/500(r/w)

As a matter of fact, tldr++ is being the one of the most popular client right now. For this amount of time its success means a lot to me. You can see its growth of popularity in time below.
Stargazers over time

I really enjoyed working with Go and had pure satisfaction of creating something at this speed. Now, I have two side-projects with Go and I’m counting time to get home and work on them. I would like to thank to Go communtiy to make this happen.

tldr; if you have an idea, with the momentum of its community Go is a great tool to make it happen swiftly!

I would like to hear your thoughts about this post. If you want to share with me, you can find me on twitter.