Transitioning to Golang

Transitioning to Golang

This is an awkward post.

Most of my last articles have been directly correlated with Python and Django. But it may surprise you that I am NOT a "python" developer per see.

I didn't pick Python, it chose me.

God, that sounds cringe, but anyways I've been learning Go in the secret depths of my living room and find it quite fascinating.  

In this article, I simply wanted to share my journey in learning Go and explain why I picked Go.

PS. I've also worked with other programming languages, most notably on PHP, but you guys will probably never get a PHP article from me.

What is Go?

Source: https://levelup.gitconnected.com/what-is-golang-and-how-to-install-it-2275236fe657

Go is the hip language on the block nowadays. It was designed by Google and first appeared in 2009, exactly 12 years ago.

But why did Google create a completely new language?

What's wrong with the others?

I am not fit to answer this question. So here's the exact answer from the Go docs:

Go was born out of frustration with existing languages and environments for the work we were doing at Google. Programming had become too difficult and the choice of languages was partly to blame. One had to choose either efficient compilation, efficient execution, or ease of programming; all three were not available in the same mainstream language. Programmers who could were choosing ease over safety and efficiency by moving to dynamically typed languages such as Python and JavaScript rather than C++ or, to a lesser extent, Java.
We were not alone in our concerns. After many years with a pretty quiet landscape for programming languages, Go was among the first of several new languages—Rust, Elixir, Swift, and more—that have made programming language development an active, almost mainstream field again.
Go addressed these issues by attempting to combine the ease of programming of an interpreted, dynamically typed language with the efficiency and safety of a statically typed, compiled language. It also aimed to be modern, with support for networked and multicore computing. Finally, working with Go is intended to be fast: it should take at most a few seconds to build a large executable on a single computer. To meet these goals required addressing a number of linguistic issues: an expressive but lightweight type system; concurrency and garbage collection; rigid dependency specification; and so on. These cannot be addressed well by libraries or tools; a new language was called for. – Go Docs

Why Go?

Source: https://hub.packtpub.com/why-golan-is-the-fastest-growing-language-on-github/

Well, I've never been a programming language oriented developer meaning that I never specifically "chose" my speciality.  

I've started my career as a frontend developer using Javascript with React, then moved to backend using PHP, later on, I moved once again to Python backend.

Why do I keep jumping?

Well, I can go on and on, on how PHP and Python are not "efficient" programming languages and why Go is superior.

But the true reason is that Go is a cool language.

And I want to be a cool programmer.  

But another major reason is that I'm super interested in distributed systems and most projects in my current company and I suppose other companies use Golang for their high load projects.  

The plan to learn Go

The plan is fairly simple. I've learned other languages before and they follow the same route.

  1. Learn Syntax
  2. Create projects
  3. Create articles on stuff you learned
  4. Create harder projects
  5. Get a Go project at work.

Learning Syntax

The syntax of Go is very interesting, it seems pythonic but at the same time is very strict like C.

Another thing is that there is a lot of emphasis on pointers, references, etc...

I like this because this is a great opportunity to finally work with low-level stuff.

Starting Projects

The first projects I made were pretty simple.

Things such as CRUD API and chat apps were fun.

But I started slowly.

I first learned how the HTTP standard library worked then moved on to some library notably gorrila/mux.

I then hooked up a database and containerized the application using Docker.  

Things I want to try out

I really want to try to code system-level stuff such as compilers or interpreters.

It's weird, in the past I've never been interested in systems programming but now I find myself somewhat keen to it.

So expect a lot of grinding nights trying to understand how compilers work.

Other ideas include creating a basic game engine.

Conclusion

This isn't life-changing.

I don't really care about programming languages, I just do what interests me. This time it happened to be Go.

I wanted to end the article on this note. It's that as software developers it's very beneficial to experiment. I would probably not be a Go guru, but heck at least I know hello world.

Thanks for Reading!

Member discussion

-->