This is the first entry in my 100 days of Go lang challenge. I will share the things I will learn each day for 100 days related to Golang or its configuration in my environment. In this post, we will understand what is golang and why you should learn it. It's not an in-depth guide but a high-level overview for understanding the context of learning Go lang.
In April 2021, I started learning Django and to date, I have more than 10 projects(not all deployed) created and publicly open on GitHub. It has been a great experience so far, I am still in between an internship with a project to be created in Django. The learning process after I started blogging in June 2021 has been a different fantasy, I have been enjoying the process of writing the things I learn. So, this Spring/Summer I am creating a challenge of 100 days for learning Go lang and documenting the process. Hopefully, this will be a useful place to learn for a beginner and more than that a place for me to reflect back on the future.
Leaving the rant aside, let's start with the best question to answer, What is Golang?
Golang (officially called Go) is a programming language developed by Google. It is statically typed like C\C++, Java, Kotlin, etc, and syntax is similar to dynamically languages like Python, Js, Ruby, Lua, etc. So, golang provides the best of both worlds, the swiftness to write code and also providing control and memory safety. Go is regarded as the language of the cloud i.e. it is heavily used in the cloud infrastructure, it involves creating microservices, APIs, containerization, orchestration, and a lot of other technologies. It can be a super useful programming language for DevOps folks and people into Cloud computing.
Though Go is designed for Cloud Infrastructure, that doesn't mean you can't use it elsewhere. There are a lot of fields in which golang nicely fits. We'll discuss why you would want to learn golang and state the domains where it can be used.
Go programmers are called Gophers
GO lang is a simple programming language, it is really easy to learn. It is quite similar to python in terms of its syntax, though it also inherits characteristics from the Java/C++ paradigm. It has a single entry point program via the
main function similar to Java/C++ languages and is compiled into binary/executable code before running. It has the standard library that provides a lot of functionalities out of the box. It provides some quite handy tools and has support for creating web applications in the core language itself.
We can see, that Go lang is almost equivalent to C and C++ porgramming language, though this might not be the best comparison of speed as it depends on quite a lot of factors and the context of programs. Still Go lang has a significant edge over Java and C++ which is a great factor because of the writing complexity involved in those programming languages.
Go lang is the modern C
Go lang is a modern language, it is not as ancient as C/C++ or Java. It is designed for Cloud-native applications which are scalable and optimized for performance meeting the needs of the modern demand for bleeding-edge technologies. It is designed by the people who created the UNIX operation, Ken Thompson. Though there were other go authors like Robert Griesemer and Rob Pike. Go lang has been designed keeping the idea of C but also considering the context of the modern world. It makes tasks like concurrency a lot simpler but it avoids dangerous and manual control of memory by not allowing pointer arithmetic.
Go land finds its use case in a lot of domains including Cloud computing, Web applications, CLI and DevOps tools, and so on. As GO is a general-purpose programming language, you can use it anywhere in the relevant fields of technology.
As Golang has capabilities to execute low-level system calls efficiently, cloud-native tools can be created in golang for improving efficiency and memory usage. As Go uses fewer resources like CPU and memory, it can optimally be used for applications that require almost no delay in the response. It also handles concurrency very well using goroutines which are way simpler to implement. All the factors contribute very well to constructing a modern cloud-native application.
Golang is used in Cloud-native technologies like
- Docker - containerisation technology
- Kubernetes - Container Orchestration
- Google Cloud - Cloud Hosting Plaform
This makes Golang widely adopted and has firm grounds for the future as well.
A lot of DevOps tools like Prometheus, Grafana, Terraform, Hugo are written natively in Go. Having appropriate features like simplicity, scalability, efficiency, and concurrency, go lang fits the DevOps space really well. Golang is already used in cloud-native technologies as mentioned earlier adopting it in the DevOps space is a great choice as it creates an even and supportive ecosystem. The
Write once and Run anywhere paradigm of java is surprisingly built-in golang as well without conversion into byte code. This is a great feature any DevOps engineer would dream of, using a single code base for multiple platforms can save a lot of time and improve productivity.
- Prometheus - Monitoring system and time series database
- Grafana - Platform for monitoring and observability
- Terraform - Building, Changing, and Versioning Infrastructure
- Minikube - Run kubernetes locally
- Kit- standard library for microservices
Golang is a widely used programmming language, it is used by some of the big companies around the world. Of course Google uses it, apart from Google, it is being used by companies like:
- Meta (facebook)
Go lang is a excellent choice for any one into web developement, cloud native, DevOps, CLI tools. Go lang being a recently developed language it has grown a lot faster than any other language in the programming world. Learning Python over the span of two years, I might want to dabble into Go but not completely leave Python. Python has a great community and is widely adopted in almost all fields in developement. Still trying out new things is what keeps you in the hunt of oppurtunitiees and meeting new people.
So starting from today, I will share my learning a new thing in Go lang every day for 100 days. At least that's the plan. The post might be in the form of a long post or a short TIL on the blog. Check out the GitHub repository for the 100 day challenge here.If you have any queries, suggestions, or feedback please let me know in the comments or on the mentioned social handles. Thank you for reading. Happy Coding :)