The Go Language

9 Jul

I am primarily a Python and JavaScript developer  (I throw in an occasional C# application which is usually for creating REST endpoints on the server side). But recently, I have started looking more seriously at Go.  The Go language is not replacing JavaScript for me, but it could replace a big chunk of my Python and C# code.

I see two big advantages in using Go – besides being fast and the whole concurrency brouhaha:

  1. Cross platform
  2. No dependencies.

Before you yell that Python is cross platform too, let me explain. The same Go code runs on Windows, MAC and Linux. So does Python, right? Well, Go code compiles to binaries for each of the operating systems. This is a big deal for me and one of the reasons I like C#. I can just deploy the .exe and it runs. No command line. No .bat file to pretend it is an .exe. This brings me to the second advantage.

Everything you need to run a Go application is in the binary. C# is great, but I can’t count the number of times I deployed an application and the user had an old version of .NET and it didn’t work. With Python it’s even worse. My development machine has every third party library I need, but getting this setup on every machine I want to deploy to is a nightmare (Docker looks like it could help with this).

There are other things I like about Go – godoc, gofmt, goget. There are also things I don’t like (I am not proficient with)  – pointers.

In later posts, I will share my Go code. For now, here is the obligatory Hello World application.

package main

import “fmt”

func main() {
fmt.Println(“Hello, World”)
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: