Three things I like about Golang

Now, Go is my second favorite language, and I want to write down why.

Firstly, I was playing with Go around 2010, and attracted it because of gofmt, which was a big surprise for me. I was always saying, “Go is nice, because they have gofm! You won’t need to care about your coding style.”. However the development environment was poor, we need to compile it with 6g , and need to write Makefile, which made me down (scon or cmake was favorite build tool at that time). At that time, it was said that it’ll take 10 years for one programming language get major, i was not into it so much.

At 2013, I was thinking about to challenge new things, and heard that Go has nice build toolset called gotool. It has passed just 3 years since it appears, so I thought it maybe too fast to begin with. Now I feel like I was wrong, Go has become a strong language that has potentially beats others.

Here’s why.

Go builds fast #

One of the big problem of C or Java is building. I think it is because of dependency. For C program, first we need to do configure and make. It runs fast compared to Java, but the thing is if we missing some component, we should download or fetch it somehow, build it, and install required. Java has maven repository, which is distributing compiled object files. It sounds we have much less build time because they’re already compiled. But you already know it is not correct, once you’ve experienced Java development. They are heavily connected and depends on many components, it’ll take more time than C build.

Talking about go, it is easy to install third-party dependency. Just run go get. It recursively get its dependencies, all you have to do is just wait. And compiling itself is also fast.

This fast build time makes me feel like I’m using very lightweight language like Javascript.

This is all comes from Go’s philosophy
Go thinks making software is not only coding but also its developing process. And this is important, they’re providing tools or language design for every Go programmer to achieve it easily. I especially like gofmt, i’ve never seen the language providing refactoring tool from the beginning.

Go runs anywhere (literary) #

It is surprising for mid-aged C programmer, Go binary links library as static. Because of this, pure Go software won’t require any environmental conditions but CPU architecture. Talking about production environment, this is critical I think. Updating middleware is always risk for production environment. Because of this, sometimes, we cannot even run simple script because they don’t have newer version of Python or Ruby. C also runs anywhere, but it requires dynamic libraries.

Of course it may (or may not) lead a problem in future because of it’s big memory print. But still, I like this design simplicity.

Go has strong type system #

Go has type system. And it’s type system is far strong than it’s of C. Since it has pointers, but it also make difference between &int and &string. (Well, needless to say, but supporting string as primitives, or function as first object primitives is also nice.) Thank you for this, if once compile passed, most of Go code will run. Or at least, easy to debug. This makes coders less troublesome.

 
13
Kudos
 
13
Kudos

Now read this

Why I won’t use docker on my MacOSX

(Appendix: since 2015, Docker accept xhyve to support native execution, this article is obsolete anymore) [Vagrant](www.vagrantup.com/), is well-known tool for using virtualization software more easily. Docker is another tool, which is... Continue →