-- Go

Go Programming Language Overview

Go Programming Language Overview

While the software is learning a new technology in the world, what the developer first wants to see is a look at the technology from the top. For this reason, an introduction to the related technology and an overview are important for the training materials. In this article, we will give an overview of Go programming language. During this overview you will not see much code. I will only examine the theoretical and provide you with various sources and suggestions about what this language is, what purpose it can be used for, where it should not be preferred.

What is Go and why has it been improved?

A technology and software giant like Google has many different programming languages(C, C++, Java, Python, etc.) and technology that it has used for years in its own internals systems. And these technologies have many different advantages and disadvantages. You may not notice these under small or light loads. However, in big projects, it definitely feels itself. These can be reviewed in a number of topics such as performance, compilation(source code compilation times for large projects), security, compliance, time management, resource management(hardware, money, energy, etc.). And if you have hundreds or thousands of developers, this is more important. Because the new expert comes with a lot of technology that he knows and needs to learn. So, the problem is both technical and mental.

Google has been developing various technologies for a long time to solve such problems. The Go programming language is one of them. The Go programming language has ben launched by Google to solve its own problems. For this reason, all features that are added to or not added to Go are decisions that are determined and implemented entirely by “software experience in large projects”. For example, if you examine the Go programming language a bit, you can ask a question such as “Why are there no generics in the Go programming language?”. And you are not the first person to ask this question. The answer given by the team that developed the Go programming language in this case is as follows: “The generics are not performance and fast, we have not found a solution yet, and we add that if we find it.”. Go programming language is so clear. The aim of this programming language is to create a language that is flexible, fast, powerful, with minimal language features and rules!

Go programming language is a fully open source language. So, you can examine the Go source code line by line. And within Google, the team responsible for developing the Go language has contributed to this language, and some technology companies in the industry have been working on a range of additional capabilities in the language of their view and recommendations. Of course, they follow the opinions of software developers like us through the developer community.

The Go programming language was developed by Ken Thompson, Rob Pike, Robert Griesiemer in 2007. Long time development and testing were done to publish the first version. The first usable version of this language was released on November 10, 2009, and the first stable version was released as Go 1.0 on March 28, 2012 with version 1.0 (version 1.0 is considered the first version matured in software).

It is simple to learn Go language syntax. However, it proved enough to compete with C/C++ in the programming domain. A number of benchmark articles on these performance tests are being published. The Go programming language has begun to be developed with the goal of “strong as C”. However, it has also developed rapidly on the part of web technologies. And it is used by large projects thanks to many libraries developed by the community. But at the same time it is simple and powerful. And it has been developed in appropriate with its technological innovations. For example, you can create a package locally, add your code page, or use a version management system such as github.com (after local installation with the ‘go get’ command).

Another of the basic principles of Go programming language developers is; “If you find the best way to do a job, you do not need different methods.”. For this reason, while there are more than one method for a job in different programming languages, there is usually a way for that job in the Go programlama language. However, thousands of professional software developers have received feedback to find this performance path.

Go is compiled as a single file. This means that you can migrate and manage on a single binary file. Moving/copying (eg .dll file) operations in languages such as Java and C# can cause serious problems and waste of time.

The syntax of the Go programming language is understandable and simple. The Go language contains 25 keywords. There are many more keywords in many languages such as C (37 keywords), C++ (84 keywords), C#, Java, Rust.

In your Go application you can run different languages like C, Python, typing your code directly. (eg cgo)

The Go programming language supports concurrency within itself. And it does it with high performance. It manages the thread logic itself without the need for low-level processing. By creating different goroutines, you can concurrent your application using hundreds/thousands of goroutines with a single thread in the bottom layer.

The syntax of the Go programming language is very important and it is important to this rule! Thus, it solves many of the problems that arise from different word-processing habits in the software world. For example, if you include a new package in your code with ‘import’ and you do not use references to that package in your application, it will fail at compile time. The same rule applies to a simple variable. You must use the variable after you have identified it, otherwise Go will issue a compilation error. This is a topic that has a direct impact on software and performance and memory management. It also checks whether the parentheses that determine the scope of a method are under the opening part or the method signature. Of course, there is also a tool to manage these syntax rules; ‘Go fmt’

It’s true;

func add(x int, y int) int {
	return x + y
}

It’s false;

func add(x int, y int) int 
{
	return x + y
}

Go Programming Language : Keywords

Go Programming Language : Types

Go Programming Language : For What?

Go programming language was developed for system programming. So it can be thought of as an ideal solution for designing and writing servers and subsystems. However, it also enables you to develop high quality projects with both rapid development and high performance for web applications as well. At the same time, the community is running a mobile project to use Go programming language on the Android operating system, although naturally not yet fully compatible. You can access mobile working resources through the github page of the Go programming language, and examine the Android application examples developed with the Go language from the internet.

The Go language can also be used for embedded systems. But in general this is not enough for this area. Yet, there are authorities that say that Go is aiming for success in this field, and that it will also develop for embedded systems over time. Moreover, even a question such as C language or C++ language for embedded systems is an issue that has been debated among C/C++ developers for years.

Examples of Go programming include embedded and similar IoT media frameworks;

Go programming language should not be used for what?

It is not a script language like Python and Ruby. So instead of replacing Python, Go is aimed to be able to work with strong languages in different areas such as C and Python. As I just mentioned above, it is not enough for embedded systems yet. The strength of the C language continues in this area. However, when combined with Go and C, great embedded system applications can be developed.

Go Programming Language Users

Although the Go language has been developed recently, it has been a preferred technology for large projects in a short time. Some of these initiatives and firms are;

Docker, Koding, Google, Apple, Twitter, Amazon, Github, Ubuntu, Dropbox, Facebook etc.

To reach a wider user list; https://github.com/golang/go/wiki/gousers

Go Programming Language : Development Tools and Environments

Go language offers a lot of tools and development environment as it is in open source culture in general. These are;

Tools;

Go tool: Go is the most basic tool of language. Go allows your application to manipulate the compilation operations parametrically through the console.

Godoc: It allows you to produce a documentation-documentation in the code, for example on the description line you write on a method. It is possible to access documents of github or online embedded language features via godoc.org site.

For example; http://godoc.org/fmt#Println

Gofmt: Go is the orchestra conductor who manages the rules of syntax. The Go code implements the syntax standards.

Development Environments(IDE’s);

Go Programming Language Installation and Official Website

Go ‘s official’ website ‘is golang.org.

Commonly Used Frameworks and Tool Sets

Note: This tool and the frameworks are the tools I have used or observed on my own. However, you can visit Awesome Go for more.

Recommended Resources;

Good work!
Cihan Özhan

Yorumla

Yorum