26
The Go Way Navneet Karnani Mandrake Technologies

Go Programming Language - Learning The Go Lang way

Embed Size (px)

Citation preview

Page 1: Go Programming Language - Learning The Go Lang way

The Go WayNavneet Karnani

Mandrake Technologies

Page 2: Go Programming Language - Learning The Go Lang way

Prerequisites

- Audience is smart and understands programming

- Ability to use Google- Audience is looking for takeaways to be

things not found on blogs

Page 3: Go Programming Language - Learning The Go Lang way

Scope

- Talk about the behavior- Look at and discuss code- Keep use cases simple to keep focus- Cover the basics to enable building on the

knowledge- Promo: Talk on Web App development using

Go later in the Conference

Page 4: Go Programming Language - Learning The Go Lang way

What is the charter of Go

Go is an open source programming language that makes it

easy to build simple, reliable,

and efficient software.

Page 5: Go Programming Language - Learning The Go Lang way

Hello world

Page 6: Go Programming Language - Learning The Go Lang way

Findings

- No semicolons- Name space- “main”

Page 7: Go Programming Language - Learning The Go Lang way

Multiply

Write an application to print multiplication tables

Hands On

Page 8: Go Programming Language - Learning The Go Lang way

STEP 1 – compute and print

Page 9: Go Programming Language - Learning The Go Lang way

Findings

- No type declarations

Page 10: Go Programming Language - Learning The Go Lang way

STEP 2 – use arrays

Page 11: Go Programming Language - Learning The Go Lang way

Findings

- Arrays are data types with a specified type and size

Page 12: Go Programming Language - Learning The Go Lang way

STEP 3 – use slices

Page 13: Go Programming Language - Learning The Go Lang way

Findings

- Views into the array

Page 14: Go Programming Language - Learning The Go Lang way

STEP 4 – test

Page 15: Go Programming Language - Learning The Go Lang way

Findings

- Test infrastructure built in- Building blocks work with Example and

Standard Conditionals- Benchmarking

Page 16: Go Programming Language - Learning The Go Lang way

STEP 5 – concurrency

Page 17: Go Programming Language - Learning The Go Lang way

Findings

- Spawning “tasks” is a first class citizen- Uses OS concept of “channels” for data

exchange

Page 18: Go Programming Language - Learning The Go Lang way

STEP 6 – MAP, References … and memory

Page 19: Go Programming Language - Learning The Go Lang way

Findings

- Go treatment of Local variables differs from other languages

- Memory allocation uses the “make” method- There is no “delete” needed

Page 20: Go Programming Language - Learning The Go Lang way

STEP 6 – Struct

Page 21: Go Programming Language - Learning The Go Lang way

Findings

- Structs are memory structures with optional associated functions and methods

Page 22: Go Programming Language - Learning The Go Lang way

STEP 7 – inteRface

Page 23: Go Programming Language - Learning The Go Lang way

Findings

- Duck Typing

Page 24: Go Programming Language - Learning The Go Lang way

Completeness

- Smart suggestions / errors- Code formatting- Dependency management- Build Tool- Testing framework- Performance measurement

Page 25: Go Programming Language - Learning The Go Lang way

https://github.com/navneetkarnani/Presentation-TheGoWay

Code

Page 26: Go Programming Language - Learning The Go Lang way

Thank You

Navneet [email protected]

@maakhansingh