Go: The Common Point of Performance and Rapid Development

Özge Büyükaşık
3 min readFeb 21, 2022

Hello everyone, I’m a senior Computer Engineering student who likes to share what I learned. I’m currently participating in BiTaksi Go Bootcamp and trying to learn Go with best practices, writing clean code, design patterns, software architecture, functional programming… There are lots of things to learn and share :) Let’s start then!

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software that is developed at Google by Robert Griesemer, Rob Pike, and Ken Thompson.

Why We Need A New Programming Language?

Developers are curious and passionate about programming languages. Developers usually refer programming languages with fast execution like C/C++ if they need high performance. Otherwise if they don’t have much time for development, they need to choose programming language that offers rapid development. That’s why Go is developed.

What Are The Main Features of Go?

The aim of the Go team was developing a programming language that works with high performance and makes the programming simpler so Go has many good features inspired by other languages with avoiding features that cause complexity.

  • Go has similarities to C so sometimes it can be described as a “C-like language” or as “C for the 21st century”.
  • Go is a compiled language. That means Go compiler converts the source code into native machine language. Therefore Go programs run fast.
“My code’s compiling” is not a valid excuse anymore!
  • Go has a simple and effective type system that offers type safety. You won’t get any type error at runtime because before running the app, compiler catch most of type errors.
  • Go has a garbage collector for memory management.
  • Go’s standart library and APIs can be used for I/O, text processing, networking and distributed applications.
  • Go has an unusual OOP approach. There is no class hierarchies or indeed any classes. In Go, you build small types and embed them into a bigger ones with reference to composition.
Composition vs. Intheritance
  • Go’s concurrency mechanisms have effective tools for utilizing multicore and networked machines. Go applications can use the available resources of the hardware effectively.

A goroutine is a lightweight thread of execution. Goroutines are like threads but they use less memory. Goroutines run concurrently with other goroutines. Channels are responsible for data communication between goroutines.

First Go App!

Every programmer knows that you couldn’t learn a programming language completely without running a Hello World application. So let’s run our first application on Go!

1- Do you have Go in your computer? If not, follow the link to download or you can use Go Playground!

2- Choose a code editor. Your can write and run your code on VS Code or GoLand.

3- Create a directory for your first project.

mkdir GoProjects
cd GoProjects
mkdir helloWorldApp
cd helloWorldApp
code .

4- Create main.go file.

5- Run your Go app.

go run main.go

There it is! Your first Go app.

We named out package and function as “main” because in Go execution starts by main function in main package. It looks like Java or C# maybe but you don’t need a class for it.

That’s all for now. Thanks for reading and I will be appreciative if you want to give some feedback. See you in Part II :) .

References

  • Go in Action by Erik St. Martin, William Kennedy and Brian Ketelsen
  • The Go Programming Language by Alan A. A. Donovan and Brian W. Kernighan

--

--