Professional Documents
Culture Documents
ACP Lecture 01 - Introduction
ACP Lecture 01 - Introduction
Lecture – 01
Introduction and Background of GO language
Go (sometimes called Golang) is one of the most popular languages today, and is a
key part of many enterprise tech stacks. Many developers prefer Go to other
languages like C++ and Scala because of its memory management model which
allows for easier concurrency.
In this course, you will learn the core constructs and techniques of the language.
After going through the basics, you will then learn more advanced Go concepts
like error-handling, networking, and templating. You'll learn how to program
efficiently in Go by gaining knowledge of common pitfalls and patterns, as well as
by building your own applications.
Course Objectives
In this course, you will learn the core constructs and techniques of the
language. After going through the basics, you will then learn more advanced
Go concepts like error-handling, networking, and templating etc.
You'll learn how to program efficiently in Go by gaining knowledge of
common pitfalls and patterns.
Building your own applications.
Exposure to current trends in Go programming and development.
Expected outcome
Quizzes Policy
o Quizzes will be conducted either in the start of class or at the end of class.
o There will be no makeup for quizzes.
Assignments and Project submission policy
o Assignments and project deliverables should be submitted on the specified dates.
o Late submission of assignment and project deliverables is strictly discouraged.
o It will result in a penalty of 25% for each day. After 2 days late assignment or
project deliverable will not be accepted.
o Copying / Plagiarism are strictly forbidden. Any student involved in copying will
be awarded grade ‘F’ in the course. The minimum possible penalty is negative
marks equal to the maximum marks in assignment / quiz / project.
o In case a student has taken / stolen submission from the other, both of the
students will be penalized.
o Same policy is applicable on project deliverables as of assignments.
Origin and Evolution of Go
Introduction
Also known as Golang, Go is a programming language designed by Robert
Griesemer, Rob Pike, and Ken Thompson. It is an open-source programming
language that makes it easy to build simple, reliable, and efficient software
solutions. Go is a statically typed and compiled programming language. Statically
typed means that variable types are explicitly declared and thus are determined at
compile time. Whereas, by compiled language we mean a language that translates
source code to machine code before execution.
History
Go’s year of genesis was 2007 at Google, and it was publicly launched in 2009
with a fully open-source BSD-style license released for the Linux and Mac OS
platforms. The first Windows-port was announced on November 22 of the same
year. Go 1.0 (the first production-ready version) was released in March 2012.
Since 2012, Go has grown from version 1.1 to 1.12 (March 2019), and work for
Go 2.0 is underway!
Continue…
The below figure shows the Go development timeline starting from its genesis
to the year 2019.
Continue…
Programming language hall of fame
Go initiated a lot of stir after its public release in January 2010. In 2009 and again
in 2016, Go was pronounced language of the year by Tiobe, which is well-known
for its popularity ranking of programming languages. In this ranking, it secured the
10th place in November 2018, with a popularity of nearly 2.5 %. The Programming
Language of the Year award is given to the programming language rated the
highest in that year. Hall of fame is given below:
Continue..
Continue…
Reasons for Developing Go
The entire Go standard library compiles in less than 20 seconds. Typical projects
compile in half a second. This lightning-fast compiling process is even faster than C
or Fortran, making compilation a non-issue. Until now, this was regarded as one of
the great benefits of using dynamic languages for development because the long
compile/link step of C++ could be skipped. However, with Go, this is no longer an
issue! Compilation times are negligible, and we have the same productivity as in the
development cycle of a scripting or dynamic language. In addition to this, the
execution speed of the native code is comparable to C/C++.
Support for memory management
Because memory problems memory leaks are a long-time problem of C++, Go’s
designers decided that memory management should not be the responsibility of a
developer. So although Go executes native code, it runs in a small runtime, which
takes care of an efficient and fast garbage collection. Go also has a built-in
runtime reflection capability.
Top Characteristics of Google’s Go
Open-Source
The foremost characteristic of Golang programming language is that it is open-
source. That means, anyone can download and experiment with the code to bring
better codes into picture and fix related bugs.
Static Typing
Go is a statically typed programming language and works with a mechanism that
makes it possible to compile code accurately while taking care of type conversions
and compatibility level. This gives developers freedom from challenges associated
with dynamically typed languages.
Concurrency Support
One of the prime characteristics of go programming language is its concurrency
support.
Golang, unlike other programming languages, offers easier and trackable
concurrency options. This makes it easier for app developers to complete requests
at a faster pace, free up allocated resources and network earlier, and much more.
Continue…
Powerful Standard Library and Tool Set
This programming language also comes loaded with a robust standard library. This
libraries offer ample components that gives developers an escape from turning
towards third party packages anymore.
Also, it offers a wider range of tools that makes development process efficient.
This includes:
• Gofmt: It automatically formats your Go code, which eventually brings a major
impact on readability.
• Gorun: This tool is used to add a ‘bang line’ in the source code to run it, or run
a similar sode code file explicitly. It is often used by Go developers when
experimenting with codes written in Python.
• Goget: The Goget tool downloads libraries from GitHub and save it to your
GoPath so that you can easily import the libraries in your app project.
• Godoc: The tool parses Go source code, including comments and creates a
documentation in HTML or plain text format. The documentation made is
tightly coupled with codes it documents and can be easily navigated with one
click.
Continue…
Testing Capabilities
Go language also offers an opportunity to write unit tests along with writing the
app codes. Besides, it avails support to understand code coverage, benchmark
tests, and write example codes to create your own code documentation.
Garbage Collection
The programming language also offers exceptional power of garbage collection.
Meaning, developers need not worry about freeing up pointers or the situation
associated with dangling pointer.
Because of these characteristics, the language has gained attention of various
popular brands.
Environmental Setup