Introduction to Golang
Hello 👋 and welcome, everyone, to my very first blog. I’m embarking on a new adventure 🏃 in the world of blogging.
So, I am gonna make you explore these topics with 3W.
- What
- Why
- Where
What is Golang?
A programming language developed and designed by the team “Google”. The team includes Robert Griesemer, Rob Pike, and Ken Thompson. The language is either know as “Go” or “Golang”.
The Golang is a statically typed language. The syntax will more or like be similar to C.
Let me explain what is statically typed.
Statically typed
It is a way in which the type checking occurs at the compile time rather than at run time.
At the time of compilation, the source code is converted to machine readable format. So, even before the compile time, all the variables should be defined with a type or in simple words, the type of the variable should be know.
Say for example, Consider a simple addition program. Here, the variables “a” and “b” are defined even before compilation.
package main
import "fmt"
func main() {
// The variable 'a' and 'b' is defined before the compile time.
var a int
var b int
a = 5
b = 6
fmt.Println(a+b)
}
Few other statically typed languages are C, C++, Java, Swift……
Other languages like Javascript, Ruby, Php are dynamically typed languages where the type checking occurs at the run-time. Let us not deviate from the actual topic.
For more information, please refer: https://en.wikipedia.org/wiki/Type_system
Why is Golang a popular choice?
Golang has gained popularity in many areas.
- Simplicity and Readability
The minimalistic syntax format makes us easy to read and write a program. Due to this, we get a maintainable and a bug free software. - Efficiency
Go guarantees speed and efficiency. It uses the system resource in a more efficient way. The language offers low-level access and better garbage collection. - Concurrency
It helps us to run concurrent threads that is we can make use of multi processor core to run programs parallelly. Say, we have a main program and we wanted to create a thread and run a different program. At this time, the main program is independent and get unaffected even if the program running in thread is affected. - Standard Library
The Golang provides multiple standard library which includes packages like encoder, decoder, HTTP packages, packages related to databases and even more. - Strong Typing
As all the type errors are caught at compile time, it helps us to build a more reliable software. - Cross-Platform
In Golang, we can write a code in one language and compile and run the program in other platforms like linux, macOS and windows. - Open Source
This language is aa open source software which has a broader and growing community due to which it stays up-to-date. - Scalability
The Golang is well suited for building scalable applications like networking and web services. - Safety and Reliability
This language enforces us to use good programming practices. It also has strong community support for security best practices. - Finally, Google’s Backing
As the golang is developed and supported by google, it gives us more credibility to its design and use. Also, Most of google projects are developed using Golang.
Where is Golang used?
The Golang is used to develop multiple domain softwares like cloud based applications, web services, networking applications and even more…..
Some of the top companies using Golang are
- Uber
- Dropbox
- IBM
- Cloudflare
- Paypal
- Netflix
As mentioned earlier, I’m embarking on a new journey into the world of blogging. With this, I’ve reached the conclusion of my first blog, and it’s time to sign off. I look forward to reconnecting with you in my next post, where we’ll explore exciting new topics together.
As I wanted to end all my blog with a quote, I am starting it right here:
“The journey of a thousand miles starts with a single step” — Laozi
Next → Packages in Golang