Introduction

Introduction #

What is GoLang? #

Go (or Golang) is a cross-platform, open-source programming language designed for simplicity, performance, and productivity.
It is a fast, statically typed, compiled language known for its simplicity and efficiency.

  • Go was developed at Google by Robert Griesemer, Rob Pike, and Ken Thompson in 2007.
  • Go’s syntax is similar to C++.
  • It can be used to create high-performance applications across different platforms (Windows, Mac, Linux, Raspberry Pi, etc.).

What is Go Used For? #

  • Web development (server-side)
  • Developing network-based programs
  • Developing cross-platform enterprise applications
  • Cloud-native development

Why Use GoLang? #

  • Go is fun and easy to learn
  • Fast run time and compilation time
  • Supports concurrency via goroutines and channels
  • Memory management with automatic garbage collection
  • Cross-platform support (Windows, Mac, Linux, Raspberry Pi, etc.)

Go Compared to Python and C++ #

FeatureGoPythonC++
TypingStatically typedDynamically typedStatically typed
Run TimeFastSlowFast
CompilationCompiledInterpretedCompiled
Compile TimeFastInterpretedSlow
ConcurrencyGoroutines and channelsNo built-in mechanismThreads
Garbage CollectionAutomaticAutomaticNo GC
Classes & ObjectsNoYesYes
InheritanceNoYesYes

Notes #

  • Compilation time refers to translating code into an executable program.
  • Concurrency means performing multiple tasks out-of-order or at the same time without affecting the final result.
  • Statically typed means variable types are known at compile time.