Opinions on Go lang

Recently I developed my first go project, a command line tool for generating metrics from web server logs. It generates web site and server metrics and saves them into a mysql database, so it is definitely not a simple hello world application. After ~2 months with go, I wanted to summarize, what I liked and what I did not. 

What I liked about Go

  1. Overall it was easy to work with. Considering the alternatives for developing a single executable that doesn't require a runtime environment installed. 
  2. Again, the effort for building a ~5MB single executable (that can read files, run operating system commands, write to mysql database etc in a multithreaded way) without any dependencies is minimal.
  3. Channels: Just awesome and really makes life easy. They are very easy to use.  
  4. Selects when used together with channels makes it really easy to implement otherwise complex scenarios
  5. Multiple return values: Not a critical feature but a nice to have
  6. Threading: Easy threading with go routines, WaitGroups and channels

What I did not like about Go

  1. Syntax: If it didn't have the unnecessary weirdnesses it would be easier to adapt. For example variable definitions,  it is x bool instead of bool x. What's the point? Most languages (used by your target audience, people who might want to move to go from other languages like java) have it the other way, what do you gain by doing it differently? 
  2. No parenthesis around if, for statements. 
  3. Shortened keywords like chan instead of channel, why? As if people are typing everything by hand using vi.
  4. make syntax: It's weird. make(map[string]map[string]interface{})
  5. "interface{}"
  6. "slice", why is it named slice
  7. Overall library and tooling availability is no where near java

Conclusion

In general, from language and required effort perspectives it's great. It definitely has original and very useful ideas. I will definitely use it again (only when it is the best option for the project).
But at the same time it feels like it was developed by people who were trying hard to make it look different, as if they were trying to be "cool" by not making it another member of the C syntax family. 

 

Comments

Popular posts from this blog

Hello world!

Web site and server monitoring for free