GoLang Diaries — Intro

·


It all starts with the company I work for changing its mindset. Well, it means, our tech-stack changes as well as our infrastructure, applications, etc.

So that’s how I met with GoLang. I have been developing with .Net since the beginning of it. When I was in college I was writing with C++ and Java. I had done my capstone project with .Net which I worked a lot on sockets and real-time communication. Well, past is past.

Over the years .Net Framework evolved to .Net Core. It was object-oriented, easy to learn and it has lots of resources to learn. I have always loved being object-oriented.


Mind-set & Preparation

In the last two months, I started to study on GoLang. I took some beginner courses and also they gave us a brief introduction to the company.

Actually documentation of the GoLang is simple and easy to find if you know what you are looking for. GoLang’s websiteis well documented. Even if you are at the beginning of your carrier or interested in programming it is easy to understand.

If you have a C or C++ background, GoLang is like updated versions of them. And the syntax is also like scripting language but do not be deceived.


Hello World!

At first, my question was how should I make my folder structure? Which IDE or Editor I should use?

I use VSCode. It has a nice GoLang extension that helps you while writing your code. It has intellisense. Also, JetBrains has GoLand IDE which provides more options to use, and debugging is easy. And I also saw people who use TextMate.

Installing GoLang is easy. Download the installation package related to your operating system.

Running is also easy. GoLang has its commands. It is nice to learn from them because you create, build, and run your apps and packages with them.

It has no runtime like .NET runtime or JAVA runtime. It compiles directly to machine code.


Packages

In .Net we use libraries. Packages are the same but not that kind of same. At first, creating packages and importing them to an application was complicated for me. But when I learned how to do it, I got the idea.


Nice things

  • Well, fast. There is no runtime as I mentioned. So all code is directly compiled to machine code.
  • If you know pointers before, like in C++, they are back. So it is easy to track how your objects are running.
  • Simple to download, create projects and run. It takes minutes to create an API.
  • Easy to learn. It has specific types and structures. There are no complex data structures, loops, etc.
  • IT’S ALL ABOUT TESTING, testing is necessary for each written code.

Challenges for me

  • Pointers, yes advantages and also disadvantage if you did not use them before. There is a learning curve, but actually, it is fundamental for programming.
  • Changing mindset is not easy if you want an abstraction, object-oriented approach.
  • In .NET or JAVA, there are many ready-to-use methods.ToList() method or Queue structures, but in GoLang you have to build them from scratch. But there are lots of packages to wrap up.

Links