SlideShare a Scribd company logo
1 of 40
www.appstud.com
Go
A modern programming language for modern times
Xwww.appstud.com
by Julien Galletta
Presentation
12
X
Mandatory hello world
NOTRERECETTESECRÈTE
12
X
package main
import "fmt"
func main() {
    fmt.Println("Hello world!")
}
History
PRESENTATION
12
X
• Designed at Google in 2007
• Publicly announced in November 2009, version 1.0 was released in
March 2012
• Version 1.12 released on February 2019
• Version 2.0 in discussion
Creators
PRESENTATION
12
X
• Robert Griesemer (Java HotSpot virtual machine, V8 Js engine)
• Rob Pike (wrote the first window system for Unix, worked on UTF-8)
• Ken Thompson (implemented the original Unix operating system,
invented the B programming language, worked on UTF-8)
Why
PRESENTATION
12
X
• Computing landscape today is almost unrelated to the environment in
which the languages being used, mostly C++, Java, and Python, had
been created: multicore processors, networked systems, massive
computation clusters, …
• Scale has changed: today’s server programs comprise tens of millions
of lines of code, are worked on by hundreds or even thousands of
programmers, and are updated literally every day
• Build times, even on large compilation clusters, have stretched to
many minutes, even hours
Who’s using it
PRESENTATION
12
X
Guiding principles
11
X
GUIDINGPRINCIPLES
11
X
• Go must work at scale, for large teams of programmers working
on them, for programs with large numbers of dependencies
• Go must be familiar, roughly C-like. Google needs to get
programmers productive quickly in Go, means that the
language cannot be too radical
• Go must be modern. It should have features like concurrency
so that programs can make efficient use of multi core machines.
It should have built-in networking and web server libraries so
that it aids modern development
Go must solve these problems
GUIDINGPRINCIPLES
11
X
Software engineering is what happens to programming when you add
time and other programmers.
— Russ Cox
• Software programming: program you write for yourself
• Software engineering: product that many people will
work on over time
Engineers will come and go, teams will grow and shrink,
requirements will change, features will be added and bugs fixed.
GUIDINGPRINCIPLES
Simplicity
• "I can’t understand this
code”
• You’re scared to make a
change because you’re
worried it’ll break another
part of the program
• A part you don’t
understand and don’t
know how to fix
11
X
Simplicity is prerequisite for
reliability.
— Edsger W. Dijkstra
GUIDINGPRINCIPLES
11
X
There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies, and the other
way is to make it so complicated that there are no obvious deficiencies.
The first method is far more difficult.
— C. A. R. Hoare
Complexity turns reliable software in unreliable software.
Complexity is what kills software projects.
Therefore simplicity is the highest goal of Go.
Whatever programs we write, we should be able to agree
that they are simple.
GUIDINGPRINCIPLES
Readability
We should strive for
readability
Readability is important
because all software is
written by humans to be read
by other humans.
Code is read many more
times than it is written. A
piece of code will, over its
lifetime, be read hundreds,
thousands of times.
11
X
Readability is essential for
maintainability.
— Mark Reinhold
Programs must be written for people
to read, and only incidentally for
machines to execute.
— Hal Abelson and Gerald Sussman
GUIDINGPRINCIPLES
11
X
The most important skill for a programmer is the ability to effectively
communicate ideas.
— Gastón Jorquera
If you can’t understand what a program is doing, how can
you hope to maintain it?
A piece of software that more than one person will
contribute to, or that will be used by people over a long
enough time that requirements or features changes, then
your goal must be for your program to be maintainable.
GUIDINGPRINCIPLES
11
X
The first step towards writing maintainable code is making
sure the code is readable.
Use the bloody brackets for fuck’s sake!
GUIDINGPRINCIPLES
Productivity
How much time do you
spend doing useful work
versus waiting for your tools,
or hopelessly lost in a foreign
code-base?
11
X
Design is the art of arranging code
to work today, and be changeable
forever.
— Sandi Metz
GUIDINGPRINCIPLES
11
X
Go was designed while waiting for a C++ program to compile.
— Go developer humour
Fast compilation is a key feature of Go.
Compilations which take minutes in other languages, take
seconds in Go
Go programmers realise that code is written to be read and
so place the act of reading code above the act of writing it.
• Tooling enforces that all code be formatted in a specific
style
GUIDINGPRINCIPLES
11
X
Go programmers don’t spend days debugging inscrutable
compile errors. They don’t waste days with complicated
build scripts or deploying code to production. And most
importantly they don’t spend their time trying to understand
what their coworker wrote.
Productivity is what the Go team mean when they say the
language must scale.
Features
14
X
Open source
FEATURES
12
X
• Free BSD license
• https://github.com/golang/go
• Main contributor is the Google team
Clean syntax
FEATURES
12
X
0
27,5
55
82,5
110
Go C Python Js Java Rust Dart Kotlin Swift C++
Number of
reserved
words in
languages
Statically typed
FEATURES
12
X
• Static typing and run-time efficiency (like C++ or Java)
• Non-strict typing (type inference)
// Initialised with 0 value
var str string
// Type inference
var i = 42
// Short syntax
isJeanAFanboy := true
Garbage collected
FEATURES
12
X
• Tricolor garbage collection
algorithm
• Optimized for latency over
throughput
Built in support for concurrency
FEATURES
12
X
Goroutines
• Lightweight thread of execution
• Go runtime multiplexes those goroutines over operating
system threads
• Multiple goroutines can run concurrently on a single
OS thread
Concurrency is about dealing with lots of things at once. Parallelism
is about doing lots of things at once.
FEATURES
12
X
No classes
No inheritance
No constructors
No annotations
No generics
No exceptions
Because fuck you.
Peculiar object-oriented model
FEATURES
12
X
• Composition only
• Structs types with methods
Interface system
• Enable loosely coupled systems
• Simply defined as set of functions
• Any type which implements those functions implicitly
implements the interface
No exceptions, handle errors yourself
FEATURES
12
X
• Forces developers to handle basic errors (no more
TODO we should handle this, probably)
• Classic go code:
beer, err := grabBeer('IPA')
if err != nil {
logger.warn('no more beer')
return err
}
// Use the beer
Great built-in libraries
FEATURES
12
X
• net/http: Provides HTTP client and server
implementations
• database/sql: For interaction with SQL databases
• encoding/json: JSON is treated as a first class
member of the standard language
• html/templates: HTML templating library
• io/utils: Implements I/O utility functions
• Testing: Automated testing
Good tooling
FEATURES
12
X
• GoFMT: automatically formats and indents your code
• Go run: compiles your code and runs it
• Godoc: equivalent of javadoc
Weaknesses
15
X
Lack of generics
WEAKNESSES
14
X
• Would complexifies the language
• Increases execution or compilation time
• Often mis-used or over-used (needless abstraction)
• Useful to avoid code duplication
• Avoid hacks with the Interface (“Any”) type
Pros
Cons
In discussion for go 2
Tedious error handling
WEAKNESSES
14
X
In discussion for go 2
• Lot of repetition
• No typed error in standard library
err := doSomething()
if err != nil {
// handle the error here
}
func doSomething() error {
err := someMethod()
if err != nil {
return err
}
err = someOther()
if err != nil {
return err
}
someOtherMethod()
}
No enumeration type
WEAKNESSES
14
X
Workarounds are verbose
GOPATH
WEAKNESSES
14
X
• Dependencies management was not part of the language before
v1.11
• Third-Party libs were available, the main one being dep
• Dep was used by a large number of people, but Go main
maintainers decided to go with a completely new implementation
they unveiled out of the blue (not cool.)
Dependency management
Before v1.11 you had to place all your go projects in the same
repository that was the same one used to checkout libs from
GitHub
Not very good for functional programming
WEAKNESSES
14
X
• No clone function
• Pointers and references
• Lacks immutability for all but a few (native) types
• Arrays and slices shares the same memory space
Conclusion
13
X
CONCLUSION
12
X
• "Gets the job done” type of language
• Easy to learn
• Fun despite its limited C-like syntax
• Focuses on readability and maintainability
• Excels in concurrency and speed
• Has a lot of room for growth and improvement
CONCLUSION
12
X
Go programming language

More Related Content

What's hot

Desenvolvimento moderno de aplicativos android
Desenvolvimento moderno de aplicativos androidDesenvolvimento moderno de aplicativos android
Desenvolvimento moderno de aplicativos androidDiego Figueredo
 
DockerCon US 2016 - Scaling Open Source operations
DockerCon US 2016 - Scaling Open Source operationsDockerCon US 2016 - Scaling Open Source operations
DockerCon US 2016 - Scaling Open Source operationsArnaud Porterie
 
Next Generation Joomla!
Next Generation Joomla!Next Generation Joomla!
Next Generation Joomla!Herman Peeren
 
How to Work Efficiently in a Hybrid Git-Perforce Environment
How to Work Efficiently in a Hybrid Git-Perforce EnvironmentHow to Work Efficiently in a Hybrid Git-Perforce Environment
How to Work Efficiently in a Hybrid Git-Perforce EnvironmentPerforce
 
Eclipse OMR: a modern toolkit for building language runtimes
Eclipse OMR: a modern toolkit for building language runtimesEclipse OMR: a modern toolkit for building language runtimes
Eclipse OMR: a modern toolkit for building language runtimesMark Stoodley
 
Advanced Video Production with FOSS
Advanced Video Production with FOSSAdvanced Video Production with FOSS
Advanced Video Production with FOSSKirk Kimmel
 
Bigger & Better RnD - GeeCON.cz 2014
Bigger & Better RnD - GeeCON.cz 2014Bigger & Better RnD - GeeCON.cz 2014
Bigger & Better RnD - GeeCON.cz 2014Juraj Michálek
 
Lotusphere 2008 Worst practices
Lotusphere 2008 Worst practicesLotusphere 2008 Worst practices
Lotusphere 2008 Worst practicesBill Buchan
 
Oopstreaming
Oopstreaming   Oopstreaming
Oopstreaming Linaro
 
Search-Driven Programming
Search-Driven ProgrammingSearch-Driven Programming
Search-Driven ProgrammingEthan Herdrick
 

What's hot (10)

Desenvolvimento moderno de aplicativos android
Desenvolvimento moderno de aplicativos androidDesenvolvimento moderno de aplicativos android
Desenvolvimento moderno de aplicativos android
 
DockerCon US 2016 - Scaling Open Source operations
DockerCon US 2016 - Scaling Open Source operationsDockerCon US 2016 - Scaling Open Source operations
DockerCon US 2016 - Scaling Open Source operations
 
Next Generation Joomla!
Next Generation Joomla!Next Generation Joomla!
Next Generation Joomla!
 
How to Work Efficiently in a Hybrid Git-Perforce Environment
How to Work Efficiently in a Hybrid Git-Perforce EnvironmentHow to Work Efficiently in a Hybrid Git-Perforce Environment
How to Work Efficiently in a Hybrid Git-Perforce Environment
 
Eclipse OMR: a modern toolkit for building language runtimes
Eclipse OMR: a modern toolkit for building language runtimesEclipse OMR: a modern toolkit for building language runtimes
Eclipse OMR: a modern toolkit for building language runtimes
 
Advanced Video Production with FOSS
Advanced Video Production with FOSSAdvanced Video Production with FOSS
Advanced Video Production with FOSS
 
Bigger & Better RnD - GeeCON.cz 2014
Bigger & Better RnD - GeeCON.cz 2014Bigger & Better RnD - GeeCON.cz 2014
Bigger & Better RnD - GeeCON.cz 2014
 
Lotusphere 2008 Worst practices
Lotusphere 2008 Worst practicesLotusphere 2008 Worst practices
Lotusphere 2008 Worst practices
 
Oopstreaming
Oopstreaming   Oopstreaming
Oopstreaming
 
Search-Driven Programming
Search-Driven ProgrammingSearch-Driven Programming
Search-Driven Programming
 

Similar to Go programming language

Golang (Go Programming Language)
Golang (Go Programming Language)Golang (Go Programming Language)
Golang (Go Programming Language)ShubhamMishra485
 
Java And Community Support
Java And Community SupportJava And Community Support
Java And Community SupportWilliam Grosso
 
GoLang - Why It Matters
GoLang -  Why It MattersGoLang -  Why It Matters
GoLang - Why It Mattersrahul
 
Go Within Cloud Foundry
Go Within Cloud FoundryGo Within Cloud Foundry
Go Within Cloud FoundryPlatform CF
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to GoSimon Hewitt
 
Top programming Languages in software Industry companies
Top programming Languages in software Industry companiesTop programming Languages in software Industry companies
Top programming Languages in software Industry companiesKiran Patil
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go langAmal Mohan N
 
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...Heiko Voigt
 
The Lives of Others: Open-Source Development Practices Elsewhere
The Lives of Others: Open-Source Development Practices ElsewhereThe Lives of Others: Open-Source Development Practices Elsewhere
The Lives of Others: Open-Source Development Practices ElsewherePeter Eisentraut
 
Top 10 programming languages
Top 10 programming languagesTop 10 programming languages
Top 10 programming languagesAman Kumar
 
Language Engineering in the Cloud
Language Engineering in the CloudLanguage Engineering in the Cloud
Language Engineering in the Cloudlennartkats
 
Creating a textual domain specific language
Creating a textual domain specific languageCreating a textual domain specific language
Creating a textual domain specific languageVicente García Díaz
 
GitLab for CI/CD process
GitLab for CI/CD processGitLab for CI/CD process
GitLab for CI/CD processHYS Enterprise
 
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...Altinity Ltd
 
Meetup 2020 - Back to the Basics part 101 : IaC
Meetup 2020 - Back to the Basics part 101 : IaCMeetup 2020 - Back to the Basics part 101 : IaC
Meetup 2020 - Back to the Basics part 101 : IaCDamienCarpy
 
Modeling on the Web
Modeling on the WebModeling on the Web
Modeling on the WebIcinetic
 

Similar to Go programming language (20)

Golang (Go Programming Language)
Golang (Go Programming Language)Golang (Go Programming Language)
Golang (Go Programming Language)
 
Java And Community Support
Java And Community SupportJava And Community Support
Java And Community Support
 
Enterprise 2020
Enterprise 2020Enterprise 2020
Enterprise 2020
 
GoLang - Why It Matters
GoLang -  Why It MattersGoLang -  Why It Matters
GoLang - Why It Matters
 
Go Within Cloud Foundry
Go Within Cloud FoundryGo Within Cloud Foundry
Go Within Cloud Foundry
 
Go fundamentals
Go fundamentalsGo fundamentals
Go fundamentals
 
Why Go Lang?
Why Go Lang?Why Go Lang?
Why Go Lang?
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Top programming Languages in software Industry companies
Top programming Languages in software Industry companiesTop programming Languages in software Industry companies
Top programming Languages in software Industry companies
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
 
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
 
The Lives of Others: Open-Source Development Practices Elsewhere
The Lives of Others: Open-Source Development Practices ElsewhereThe Lives of Others: Open-Source Development Practices Elsewhere
The Lives of Others: Open-Source Development Practices Elsewhere
 
Top 10 programming languages
Top 10 programming languagesTop 10 programming languages
Top 10 programming languages
 
Language Engineering in the Cloud
Language Engineering in the CloudLanguage Engineering in the Cloud
Language Engineering in the Cloud
 
Creating a textual domain specific language
Creating a textual domain specific languageCreating a textual domain specific language
Creating a textual domain specific language
 
Node.js vs. python
Node.js vs. pythonNode.js vs. python
Node.js vs. python
 
GitLab for CI/CD process
GitLab for CI/CD processGitLab for CI/CD process
GitLab for CI/CD process
 
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...
 
Meetup 2020 - Back to the Basics part 101 : IaC
Meetup 2020 - Back to the Basics part 101 : IaCMeetup 2020 - Back to the Basics part 101 : IaC
Meetup 2020 - Back to the Basics part 101 : IaC
 
Modeling on the Web
Modeling on the WebModeling on the Web
Modeling on the Web
 

More from Appstud

Appstalk techniques photos
Appstalk techniques photosAppstalk techniques photos
Appstalk techniques photosAppstud
 
Internet Of Things
Internet Of ThingsInternet Of Things
Internet Of ThingsAppstud
 
KaRma Sutra
KaRma SutraKaRma Sutra
KaRma SutraAppstud
 
Applications of Artificial Intelligence
Applications of Artificial IntelligenceApplications of Artificial Intelligence
Applications of Artificial IntelligenceAppstud
 
Quand les croyances impactent notre bonheur
Quand les croyances impactent notre bonheurQuand les croyances impactent notre bonheur
Quand les croyances impactent notre bonheurAppstud
 
La collapsologie : l’effondrement de la civilisation thermo-industrielle
La collapsologie : l’effondrement de la civilisation thermo-industrielleLa collapsologie : l’effondrement de la civilisation thermo-industrielle
La collapsologie : l’effondrement de la civilisation thermo-industrielleAppstud
 
Apple WorldWide Developers Conference 2019
Apple WorldWide Developers Conference 2019Apple WorldWide Developers Conference 2019
Apple WorldWide Developers Conference 2019Appstud
 
L'utilisation du digital par l'agent de Police Municipale
L'utilisation du digital par l'agent de Police MunicipaleL'utilisation du digital par l'agent de Police Municipale
L'utilisation du digital par l'agent de Police MunicipaleAppstud
 
Android makers
Android makersAndroid makers
Android makersAppstud
 
Notre cerveau entre rêve et réalité
Notre cerveau entre rêve et réalité Notre cerveau entre rêve et réalité
Notre cerveau entre rêve et réalité Appstud
 
Presentation gamification
Presentation gamificationPresentation gamification
Presentation gamificationAppstud
 
Infographie appstud.png
Infographie appstud.pngInfographie appstud.png
Infographie appstud.pngAppstud
 
Tests et KPI(s) - quoi, pourquoi, comment ?
Tests et KPI(s) - quoi, pourquoi, comment ?Tests et KPI(s) - quoi, pourquoi, comment ?
Tests et KPI(s) - quoi, pourquoi, comment ?Appstud
 
Idées VS échecs
Idées VS échecs Idées VS échecs
Idées VS échecs Appstud
 
Blockchain
BlockchainBlockchain
BlockchainAppstud
 
Présentation Flutter
Présentation FlutterPrésentation Flutter
Présentation FlutterAppstud
 
La programmation neuro-linguistique
La programmation neuro-linguistiqueLa programmation neuro-linguistique
La programmation neuro-linguistiqueAppstud
 
Le futur de l'acquisition sur mobile
Le futur de l'acquisition sur mobile Le futur de l'acquisition sur mobile
Le futur de l'acquisition sur mobile Appstud
 
Intelligence Artificielle - La technique et l'éthique
Intelligence Artificielle - La technique et l'éthique Intelligence Artificielle - La technique et l'éthique
Intelligence Artificielle - La technique et l'éthique Appstud
 
API Web Moderne avec GRPC
API Web Moderne avec GRPCAPI Web Moderne avec GRPC
API Web Moderne avec GRPCAppstud
 

More from Appstud (20)

Appstalk techniques photos
Appstalk techniques photosAppstalk techniques photos
Appstalk techniques photos
 
Internet Of Things
Internet Of ThingsInternet Of Things
Internet Of Things
 
KaRma Sutra
KaRma SutraKaRma Sutra
KaRma Sutra
 
Applications of Artificial Intelligence
Applications of Artificial IntelligenceApplications of Artificial Intelligence
Applications of Artificial Intelligence
 
Quand les croyances impactent notre bonheur
Quand les croyances impactent notre bonheurQuand les croyances impactent notre bonheur
Quand les croyances impactent notre bonheur
 
La collapsologie : l’effondrement de la civilisation thermo-industrielle
La collapsologie : l’effondrement de la civilisation thermo-industrielleLa collapsologie : l’effondrement de la civilisation thermo-industrielle
La collapsologie : l’effondrement de la civilisation thermo-industrielle
 
Apple WorldWide Developers Conference 2019
Apple WorldWide Developers Conference 2019Apple WorldWide Developers Conference 2019
Apple WorldWide Developers Conference 2019
 
L'utilisation du digital par l'agent de Police Municipale
L'utilisation du digital par l'agent de Police MunicipaleL'utilisation du digital par l'agent de Police Municipale
L'utilisation du digital par l'agent de Police Municipale
 
Android makers
Android makersAndroid makers
Android makers
 
Notre cerveau entre rêve et réalité
Notre cerveau entre rêve et réalité Notre cerveau entre rêve et réalité
Notre cerveau entre rêve et réalité
 
Presentation gamification
Presentation gamificationPresentation gamification
Presentation gamification
 
Infographie appstud.png
Infographie appstud.pngInfographie appstud.png
Infographie appstud.png
 
Tests et KPI(s) - quoi, pourquoi, comment ?
Tests et KPI(s) - quoi, pourquoi, comment ?Tests et KPI(s) - quoi, pourquoi, comment ?
Tests et KPI(s) - quoi, pourquoi, comment ?
 
Idées VS échecs
Idées VS échecs Idées VS échecs
Idées VS échecs
 
Blockchain
BlockchainBlockchain
Blockchain
 
Présentation Flutter
Présentation FlutterPrésentation Flutter
Présentation Flutter
 
La programmation neuro-linguistique
La programmation neuro-linguistiqueLa programmation neuro-linguistique
La programmation neuro-linguistique
 
Le futur de l'acquisition sur mobile
Le futur de l'acquisition sur mobile Le futur de l'acquisition sur mobile
Le futur de l'acquisition sur mobile
 
Intelligence Artificielle - La technique et l'éthique
Intelligence Artificielle - La technique et l'éthique Intelligence Artificielle - La technique et l'éthique
Intelligence Artificielle - La technique et l'éthique
 
API Web Moderne avec GRPC
API Web Moderne avec GRPCAPI Web Moderne avec GRPC
API Web Moderne avec GRPC
 

Recently uploaded

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Recently uploaded (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Go programming language

  • 1. www.appstud.com Go A modern programming language for modern times Xwww.appstud.com by Julien Galletta
  • 3. Mandatory hello world NOTRERECETTESECRÈTE 12 X package main import "fmt" func main() {     fmt.Println("Hello world!") }
  • 4. History PRESENTATION 12 X • Designed at Google in 2007 • Publicly announced in November 2009, version 1.0 was released in March 2012 • Version 1.12 released on February 2019 • Version 2.0 in discussion
  • 5. Creators PRESENTATION 12 X • Robert Griesemer (Java HotSpot virtual machine, V8 Js engine) • Rob Pike (wrote the first window system for Unix, worked on UTF-8) • Ken Thompson (implemented the original Unix operating system, invented the B programming language, worked on UTF-8)
  • 6. Why PRESENTATION 12 X • Computing landscape today is almost unrelated to the environment in which the languages being used, mostly C++, Java, and Python, had been created: multicore processors, networked systems, massive computation clusters, … • Scale has changed: today’s server programs comprise tens of millions of lines of code, are worked on by hundreds or even thousands of programmers, and are updated literally every day • Build times, even on large compilation clusters, have stretched to many minutes, even hours
  • 9. GUIDINGPRINCIPLES 11 X • Go must work at scale, for large teams of programmers working on them, for programs with large numbers of dependencies • Go must be familiar, roughly C-like. Google needs to get programmers productive quickly in Go, means that the language cannot be too radical • Go must be modern. It should have features like concurrency so that programs can make efficient use of multi core machines. It should have built-in networking and web server libraries so that it aids modern development Go must solve these problems
  • 10. GUIDINGPRINCIPLES 11 X Software engineering is what happens to programming when you add time and other programmers. — Russ Cox • Software programming: program you write for yourself • Software engineering: product that many people will work on over time Engineers will come and go, teams will grow and shrink, requirements will change, features will be added and bugs fixed.
  • 11. GUIDINGPRINCIPLES Simplicity • "I can’t understand this code” • You’re scared to make a change because you’re worried it’ll break another part of the program • A part you don’t understand and don’t know how to fix 11 X Simplicity is prerequisite for reliability. — Edsger W. Dijkstra
  • 12. GUIDINGPRINCIPLES 11 X There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult. — C. A. R. Hoare Complexity turns reliable software in unreliable software. Complexity is what kills software projects. Therefore simplicity is the highest goal of Go. Whatever programs we write, we should be able to agree that they are simple.
  • 13. GUIDINGPRINCIPLES Readability We should strive for readability Readability is important because all software is written by humans to be read by other humans. Code is read many more times than it is written. A piece of code will, over its lifetime, be read hundreds, thousands of times. 11 X Readability is essential for maintainability. — Mark Reinhold Programs must be written for people to read, and only incidentally for machines to execute. — Hal Abelson and Gerald Sussman
  • 14. GUIDINGPRINCIPLES 11 X The most important skill for a programmer is the ability to effectively communicate ideas. — Gastón Jorquera If you can’t understand what a program is doing, how can you hope to maintain it? A piece of software that more than one person will contribute to, or that will be used by people over a long enough time that requirements or features changes, then your goal must be for your program to be maintainable.
  • 15. GUIDINGPRINCIPLES 11 X The first step towards writing maintainable code is making sure the code is readable. Use the bloody brackets for fuck’s sake!
  • 16. GUIDINGPRINCIPLES Productivity How much time do you spend doing useful work versus waiting for your tools, or hopelessly lost in a foreign code-base? 11 X Design is the art of arranging code to work today, and be changeable forever. — Sandi Metz
  • 17. GUIDINGPRINCIPLES 11 X Go was designed while waiting for a C++ program to compile. — Go developer humour Fast compilation is a key feature of Go. Compilations which take minutes in other languages, take seconds in Go Go programmers realise that code is written to be read and so place the act of reading code above the act of writing it. • Tooling enforces that all code be formatted in a specific style
  • 18. GUIDINGPRINCIPLES 11 X Go programmers don’t spend days debugging inscrutable compile errors. They don’t waste days with complicated build scripts or deploying code to production. And most importantly they don’t spend their time trying to understand what their coworker wrote. Productivity is what the Go team mean when they say the language must scale.
  • 20. Open source FEATURES 12 X • Free BSD license • https://github.com/golang/go • Main contributor is the Google team
  • 21. Clean syntax FEATURES 12 X 0 27,5 55 82,5 110 Go C Python Js Java Rust Dart Kotlin Swift C++ Number of reserved words in languages
  • 22. Statically typed FEATURES 12 X • Static typing and run-time efficiency (like C++ or Java) • Non-strict typing (type inference) // Initialised with 0 value var str string // Type inference var i = 42 // Short syntax isJeanAFanboy := true
  • 23. Garbage collected FEATURES 12 X • Tricolor garbage collection algorithm • Optimized for latency over throughput
  • 24. Built in support for concurrency FEATURES 12 X Goroutines • Lightweight thread of execution • Go runtime multiplexes those goroutines over operating system threads • Multiple goroutines can run concurrently on a single OS thread Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once.
  • 25. FEATURES 12 X No classes No inheritance No constructors No annotations No generics No exceptions Because fuck you.
  • 26. Peculiar object-oriented model FEATURES 12 X • Composition only • Structs types with methods Interface system • Enable loosely coupled systems • Simply defined as set of functions • Any type which implements those functions implicitly implements the interface
  • 27. No exceptions, handle errors yourself FEATURES 12 X • Forces developers to handle basic errors (no more TODO we should handle this, probably) • Classic go code: beer, err := grabBeer('IPA') if err != nil { logger.warn('no more beer') return err } // Use the beer
  • 28. Great built-in libraries FEATURES 12 X • net/http: Provides HTTP client and server implementations • database/sql: For interaction with SQL databases • encoding/json: JSON is treated as a first class member of the standard language • html/templates: HTML templating library • io/utils: Implements I/O utility functions • Testing: Automated testing
  • 29. Good tooling FEATURES 12 X • GoFMT: automatically formats and indents your code • Go run: compiles your code and runs it • Godoc: equivalent of javadoc
  • 31. Lack of generics WEAKNESSES 14 X • Would complexifies the language • Increases execution or compilation time • Often mis-used or over-used (needless abstraction) • Useful to avoid code duplication • Avoid hacks with the Interface (“Any”) type Pros Cons In discussion for go 2
  • 32. Tedious error handling WEAKNESSES 14 X In discussion for go 2 • Lot of repetition • No typed error in standard library err := doSomething() if err != nil { // handle the error here } func doSomething() error { err := someMethod() if err != nil { return err } err = someOther() if err != nil { return err } someOtherMethod() }
  • 34. GOPATH WEAKNESSES 14 X • Dependencies management was not part of the language before v1.11 • Third-Party libs were available, the main one being dep • Dep was used by a large number of people, but Go main maintainers decided to go with a completely new implementation they unveiled out of the blue (not cool.) Dependency management Before v1.11 you had to place all your go projects in the same repository that was the same one used to checkout libs from GitHub
  • 35. Not very good for functional programming WEAKNESSES 14 X • No clone function • Pointers and references • Lacks immutability for all but a few (native) types • Arrays and slices shares the same memory space
  • 37.
  • 38. CONCLUSION 12 X • "Gets the job done” type of language • Easy to learn • Fun despite its limited C-like syntax • Focuses on readability and maintainability • Excels in concurrency and speed • Has a lot of room for growth and improvement