SlideShare uma empresa Scribd logo
1 de 48
Baixar para ler offline
ROME April 11-12th 2014
Go is your friend
Gianfranco Reppucci	

Lead Developer at Qurami
giefferre
ROME April 11-12th 2014 - Gianfranco Reppucci
About me
ROME April 11-12th 2014 - Gianfranco Reppucci
ROME April 11-12th 2014 - Gianfranco Reppucci
Evolution
As developers,	

we’ve changed a lot since a decade ago
ROME April 11-12th 2014 - Gianfranco Reppucci
Evolution
• Monolithic, 100% custom code	

• Super-complete, MVC frameworks
with tons of built-in features	

• Simple, bootstrapping frameworks

w/ dependency managers
ROME April 11-12th 2014 - Gianfranco Reppucci
Context
• There is a lot of different languages
available to developers	

• Some of them are pretty easy, some
others have great performances	

• We can find frameworks and plugins for
each of them
ROME April 11-12th 2014 - Gianfranco Reppucci
The big dilemma
I’m starting a new project.	

Which technology do you think I should use?
ROME April 11-12th 2014 - Gianfranco Reppucci
There’s no right choice
As developers:	

• A great idea can be built with
(perhaps) any language	

• Pros and cons are everywhere	

• You’ll pay a certain price for whatever
advantages you could have
ROME April 11-12th 2014 - Gianfranco Reppucci
There’s no right choice
As entrepreneurs:	

• When choosing a specific technology,

you’ll probably need to justify the
decision to yourself, your partners and
investors	

• Decisions would be based on
company’s vision
ROME April 11-12th 2014 - Gianfranco Reppucci
Start using

something modern
Go is an open source programming language

that makes it easy to build simple,

reliable and efficient software.
quote from golang.org
ROME April 11-12th 2014 - Gianfranco Reppucci
What Go is:
• Open source BSD licensed project	

• Language specification	

• Runtime components

(garbage collector, scheduler, etc)	

• Two different compilers (gc or gccgo)	

• Standard libraries	

• Documentation
ROME April 11-12th 2014 - Gianfranco Reppucci
History
• Developed at Google in 2007 as an
experiment	

• Publicly announced in 2009	

• Integrated in App Engine in 2011
ROME April 11-12th 2014 - Gianfranco Reppucci
Who is using Go?
ROME April 11-12th 2014 - Gianfranco Reppucci
Who is using Go?
ROME April 11-12th 2014 - Gianfranco Reppucci
A modern C
Go sits somewhere between C and Python.
!
It has the static type checking and bit-
twiddling powers of C, yet much of the speed
of development and conciseness of Python.
quote from Graham King
ROME April 11-12th 2014 - Gianfranco Reppucci
Absolutely genuine
• No class inheritance	

• No method or operator overloading	

• No circular dependencies among packages	

• No generic programming	

• No assertions	

• No pointer arithmetic
ROME April 11-12th 2014 - Gianfranco Reppucci
Performance driven
Built-in concurrency primitives:	

• light-weight threads, called goroutines	

• channels	

• select statements
ROME April 11-12th 2014 - Gianfranco Reppucci
I mean, seriously
ROME April 11-12th 2014 - Gianfranco Reppucci
I mean, seriously
ROME April 11-12th 2014 - Gianfranco Reppucci
I mean, seriously
ROME April 11-12th 2014 - Gianfranco Reppucci
Does God exist?
• If you have doubts or issues when
styling your Go code, you can use
gofmt	

• gofmt’s aim is to format Go files,
returning a valid and “beautified”
version of the code
ROME April 11-12th 2014 - Gianfranco Reppucci
A little bit of code
ROME April 11-12th 2014 - Gianfranco Reppucci
Object Oriented Go
ROME April 11-12th 2014 - Gianfranco Reppucci
A type declaration
! type Name struct {!
! ! First string!
! ! Middle string!
! ! Last string!
! }
ROME April 11-12th 2014 - Gianfranco Reppucci
A method declaration
! func (n Name) String() string {!
! ! return fmt.Sprintf(!
! ! ! “%s %c. %s”,!
! ! ! n.First,!
! ! ! n.Middle[0],!
! ! ! n.Last,!
! ! )!
! }
ROME April 11-12th 2014 - Gianfranco Reppucci
Instancing a Name
! aName := Name{“John”, “Go”, “White”}!
!
! fmt.Println(aName.String())
ROME April 11-12th 2014 - Gianfranco Reppucci
Goroutines
ROME April 11-12th 2014 - Gianfranco Reppucci
Given the yell function
func yell(word string, seconds int) {!
! time.Sleep(time.Duration(seconds) * time.Second)!
! fmt.Println(word)!
}
ROME April 11-12th 2014 - Gianfranco Reppucci
Guess what’s the output
func main() {!
! go yell(“2014”, 5)!
! go yell(“Codemotion”, 1)!
! go yell(“Roma”, 4)!
! time.Sleep(10 * time.Second)!
}
ROME April 11-12th 2014 - Gianfranco Reppucci
Channels
ROME April 11-12th 2014 - Gianfranco Reppucci
Channels
• Implement parallelism and
synchronization	

• Channels can be of any type of data
structure, even custom structs	

• Can be buffered or unbuffered
ROME April 11-12th 2014 - Gianfranco Reppucci
An example
c := make(chan int)!
!
go func() {!
! list.Sort()!
! c <- 1!
}()!
!
doSomethingForAWhile()!
<-c
ROME April 11-12th 2014 - Gianfranco Reppucci
Select statement
ROME April 11-12th 2014 - Gianfranco Reppucci
Select
The select statement is like a switch, but

it selects over channel operations and

chooses exactly one of them
ROME April 11-12th 2014 - Gianfranco Reppucci
An example
ticker := time.NewTicker(250 * time.Millisecond)!
boom := time.After(1 * time.Second)!
!
for {!
! select {!
! ! case <- ticker.C:!
! ! ! fmt.Println(“tick”)!
! ! case <- boom:!
! ! ! fmt.Println(“BOOM!”)!
! ! ! return!
! }!
}
ROME April 11-12th 2014 - Gianfranco Reppucci
Start writing your

Go code now
Open your browser and point it to	

http://tour.golang.org	

for a quick tour, or	

http://play.golang.org	

to test your own snippets online
ROME April 11-12th 2014 - Gianfranco Reppucci
Why should I use Go?
• Syntax and environments are similar to
dynamic languages	

• Simple language specification	

• Powerful and lightweight
ROME April 11-12th 2014 - Gianfranco Reppucci
Why should I use Go?
• Full development environment

(doc, dependencies, formatter, tests)	

• Static compilation

with NO dependencies binary output	

• Multi environment build
ROME April 11-12th 2014 - Gianfranco Reppucci
So, what’s Go about?
ROME April 11-12th 2014 - Gianfranco Reppucci
Composition
• Go is Object Oriented,

BUT not in the usual way!	

• Simple data models, simple interfaces
ROME April 11-12th 2014 - Gianfranco Reppucci
Concurrency
• Easily readable concurrency primitives
ROME April 11-12th 2014 - Gianfranco Reppucci
Gophers
ROME April 11-12th 2014 - Gianfranco Reppucci
ROME April 11-12th 2014 - Gianfranco Reppucci
Join us tonight
GOLANGIT
Meetup	

18:40 - 19.40
ROME April 11-12th 2014 - Gianfranco Reppucci
Thank you!
Gianfranco Reppucci
giefferre
ROME April 11-12th 2014 - Gianfranco Reppucci
References
• The gopher images were created by Renee
French and they are Creative Commons
Attribution 3.0 licensed	

• What technology should my startup use? by
Matt Aimonetti	

• Go after four months by Graham King	

• Golang on Google’s App Engine
ROME April 11-12th 2014 - Gianfranco Reppucci
References
• List of organizations that use Go	

• The gopher look, a photo by Ken Conley 	

• How we went from 30 servers to 2 by Travis
Reeder	

• Go after 2 years in production by Travis
Reeder	

• Computer Language Benchmarks Game
ROME April 11-12th 2014 - Gianfranco Reppucci
References
• Go at Google	

• Docker and Go: why did we decide to write
docker in Go?

Mais conteúdo relacionado

Semelhante a Go is your friend

Oop design magma rails 2011
Oop design   magma rails 2011Oop design   magma rails 2011
Oop design magma rails 2011MagmaConf
 
WorkoutBuds Presentation #5
WorkoutBuds Presentation #5WorkoutBuds Presentation #5
WorkoutBuds Presentation #5Andre Sofian
 
Puppet Camp Berlin 2014: Module Rewriting the Smart Way
Puppet Camp Berlin 2014: Module Rewriting the Smart Way Puppet Camp Berlin 2014: Module Rewriting the Smart Way
Puppet Camp Berlin 2014: Module Rewriting the Smart Way Puppet
 
The Poly Pinoy, Redux
The Poly Pinoy, ReduxThe Poly Pinoy, Redux
The Poly Pinoy, ReduxMiguel Paraz
 
Secret sauce of building php applications
Secret sauce of building php applicationsSecret sauce of building php applications
Secret sauce of building php applicationsLin Yo-An
 
Superman or Ironman - can everyone be a 10x developer?
Superman or Ironman - can everyone be a 10x developer?Superman or Ironman - can everyone be a 10x developer?
Superman or Ironman - can everyone be a 10x developer?Steve Poole
 
DevOps Army of N - Recovering From Being A Human SPOF
DevOps Army of N - Recovering From Being A Human SPOFDevOps Army of N - Recovering From Being A Human SPOF
DevOps Army of N - Recovering From Being A Human SPOFfunjon
 
PHP Workshop at ISCTE-IUL Mar 2015
PHP Workshop at ISCTE-IUL Mar 2015PHP Workshop at ISCTE-IUL Mar 2015
PHP Workshop at ISCTE-IUL Mar 2015André Aleixo
 
PHP - Beginner's Workshop
PHP - Beginner's WorkshopPHP - Beginner's Workshop
PHP - Beginner's WorkshopRafael Pinto
 
Puppet camp London 2014: Module Rewriting The Smart Way
Puppet camp London 2014: Module Rewriting The Smart WayPuppet camp London 2014: Module Rewriting The Smart Way
Puppet camp London 2014: Module Rewriting The Smart WayPuppet
 
Puppet camp london-modulerewritingsmartway
Puppet camp london-modulerewritingsmartwayPuppet camp london-modulerewritingsmartway
Puppet camp london-modulerewritingsmartwayMartin Alfke
 
Developing locally with virtual machines
Developing locally with virtual machinesDeveloping locally with virtual machines
Developing locally with virtual machineswhurleyf1
 
Fmp production log_13
Fmp production log_13Fmp production log_13
Fmp production log_13Gladeatorkid
 
What's the "right" PHP Framework?
What's the "right" PHP Framework?What's the "right" PHP Framework?
What's the "right" PHP Framework?Barry Jones
 
Vimeo and Open Source (SMPTE Forum 2015)
Vimeo and Open Source (SMPTE Forum 2015)Vimeo and Open Source (SMPTE Forum 2015)
Vimeo and Open Source (SMPTE Forum 2015)Derek Buitenhuis
 
Puppet Camp Paris 2014: Module Rewriting The Smart Way
Puppet Camp Paris 2014: Module Rewriting The Smart WayPuppet Camp Paris 2014: Module Rewriting The Smart Way
Puppet Camp Paris 2014: Module Rewriting The Smart WayPuppet
 
Symfony4 - A new way of developing web applications
Symfony4 - A new way of developing web applicationsSymfony4 - A new way of developing web applications
Symfony4 - A new way of developing web applicationsAntonio Peric-Mazar
 

Semelhante a Go is your friend (20)

Oop design magma rails 2011
Oop design   magma rails 2011Oop design   magma rails 2011
Oop design magma rails 2011
 
Introduction to Apache Solr
Introduction to Apache SolrIntroduction to Apache Solr
Introduction to Apache Solr
 
WorkoutBuds Presentation #5
WorkoutBuds Presentation #5WorkoutBuds Presentation #5
WorkoutBuds Presentation #5
 
Puppet Camp Berlin 2014: Module Rewriting the Smart Way
Puppet Camp Berlin 2014: Module Rewriting the Smart Way Puppet Camp Berlin 2014: Module Rewriting the Smart Way
Puppet Camp Berlin 2014: Module Rewriting the Smart Way
 
Using visualization tools to access HDF data via OPeNDAP
Using visualization tools to access HDF data via OPeNDAP Using visualization tools to access HDF data via OPeNDAP
Using visualization tools to access HDF data via OPeNDAP
 
The Poly Pinoy, Redux
The Poly Pinoy, ReduxThe Poly Pinoy, Redux
The Poly Pinoy, Redux
 
Secret sauce of building php applications
Secret sauce of building php applicationsSecret sauce of building php applications
Secret sauce of building php applications
 
Superman or Ironman - can everyone be a 10x developer?
Superman or Ironman - can everyone be a 10x developer?Superman or Ironman - can everyone be a 10x developer?
Superman or Ironman - can everyone be a 10x developer?
 
DevOps Army of N - Recovering From Being A Human SPOF
DevOps Army of N - Recovering From Being A Human SPOFDevOps Army of N - Recovering From Being A Human SPOF
DevOps Army of N - Recovering From Being A Human SPOF
 
Ketenintegratie TradeCloud FME Fedecom - Agrifac
Ketenintegratie TradeCloud FME Fedecom - AgrifacKetenintegratie TradeCloud FME Fedecom - Agrifac
Ketenintegratie TradeCloud FME Fedecom - Agrifac
 
PHP Workshop at ISCTE-IUL Mar 2015
PHP Workshop at ISCTE-IUL Mar 2015PHP Workshop at ISCTE-IUL Mar 2015
PHP Workshop at ISCTE-IUL Mar 2015
 
PHP - Beginner's Workshop
PHP - Beginner's WorkshopPHP - Beginner's Workshop
PHP - Beginner's Workshop
 
Puppet camp London 2014: Module Rewriting The Smart Way
Puppet camp London 2014: Module Rewriting The Smart WayPuppet camp London 2014: Module Rewriting The Smart Way
Puppet camp London 2014: Module Rewriting The Smart Way
 
Puppet camp london-modulerewritingsmartway
Puppet camp london-modulerewritingsmartwayPuppet camp london-modulerewritingsmartway
Puppet camp london-modulerewritingsmartway
 
Developing locally with virtual machines
Developing locally with virtual machinesDeveloping locally with virtual machines
Developing locally with virtual machines
 
Fmp production log_13
Fmp production log_13Fmp production log_13
Fmp production log_13
 
What's the "right" PHP Framework?
What's the "right" PHP Framework?What's the "right" PHP Framework?
What's the "right" PHP Framework?
 
Vimeo and Open Source (SMPTE Forum 2015)
Vimeo and Open Source (SMPTE Forum 2015)Vimeo and Open Source (SMPTE Forum 2015)
Vimeo and Open Source (SMPTE Forum 2015)
 
Puppet Camp Paris 2014: Module Rewriting The Smart Way
Puppet Camp Paris 2014: Module Rewriting The Smart WayPuppet Camp Paris 2014: Module Rewriting The Smart Way
Puppet Camp Paris 2014: Module Rewriting The Smart Way
 
Symfony4 - A new way of developing web applications
Symfony4 - A new way of developing web applicationsSymfony4 - A new way of developing web applications
Symfony4 - A new way of developing web applications
 

Último

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 

Último (20)

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 

Go is your friend

  • 1. ROME April 11-12th 2014 Go is your friend Gianfranco Reppucci Lead Developer at Qurami giefferre
  • 2. ROME April 11-12th 2014 - Gianfranco Reppucci About me
  • 3. ROME April 11-12th 2014 - Gianfranco Reppucci
  • 4. ROME April 11-12th 2014 - Gianfranco Reppucci Evolution As developers, we’ve changed a lot since a decade ago
  • 5. ROME April 11-12th 2014 - Gianfranco Reppucci Evolution • Monolithic, 100% custom code • Super-complete, MVC frameworks with tons of built-in features • Simple, bootstrapping frameworks
 w/ dependency managers
  • 6. ROME April 11-12th 2014 - Gianfranco Reppucci Context • There is a lot of different languages available to developers • Some of them are pretty easy, some others have great performances • We can find frameworks and plugins for each of them
  • 7. ROME April 11-12th 2014 - Gianfranco Reppucci The big dilemma I’m starting a new project. Which technology do you think I should use?
  • 8. ROME April 11-12th 2014 - Gianfranco Reppucci There’s no right choice As developers: • A great idea can be built with (perhaps) any language • Pros and cons are everywhere • You’ll pay a certain price for whatever advantages you could have
  • 9. ROME April 11-12th 2014 - Gianfranco Reppucci There’s no right choice As entrepreneurs: • When choosing a specific technology,
 you’ll probably need to justify the decision to yourself, your partners and investors • Decisions would be based on company’s vision
  • 10. ROME April 11-12th 2014 - Gianfranco Reppucci Start using
 something modern Go is an open source programming language
 that makes it easy to build simple,
 reliable and efficient software. quote from golang.org
  • 11. ROME April 11-12th 2014 - Gianfranco Reppucci What Go is: • Open source BSD licensed project • Language specification • Runtime components
 (garbage collector, scheduler, etc) • Two different compilers (gc or gccgo) • Standard libraries • Documentation
  • 12. ROME April 11-12th 2014 - Gianfranco Reppucci History • Developed at Google in 2007 as an experiment • Publicly announced in 2009 • Integrated in App Engine in 2011
  • 13. ROME April 11-12th 2014 - Gianfranco Reppucci Who is using Go?
  • 14. ROME April 11-12th 2014 - Gianfranco Reppucci Who is using Go?
  • 15. ROME April 11-12th 2014 - Gianfranco Reppucci A modern C Go sits somewhere between C and Python. ! It has the static type checking and bit- twiddling powers of C, yet much of the speed of development and conciseness of Python. quote from Graham King
  • 16. ROME April 11-12th 2014 - Gianfranco Reppucci Absolutely genuine • No class inheritance • No method or operator overloading • No circular dependencies among packages • No generic programming • No assertions • No pointer arithmetic
  • 17. ROME April 11-12th 2014 - Gianfranco Reppucci Performance driven Built-in concurrency primitives: • light-weight threads, called goroutines • channels • select statements
  • 18. ROME April 11-12th 2014 - Gianfranco Reppucci I mean, seriously
  • 19. ROME April 11-12th 2014 - Gianfranco Reppucci I mean, seriously
  • 20. ROME April 11-12th 2014 - Gianfranco Reppucci I mean, seriously
  • 21. ROME April 11-12th 2014 - Gianfranco Reppucci Does God exist? • If you have doubts or issues when styling your Go code, you can use gofmt • gofmt’s aim is to format Go files, returning a valid and “beautified” version of the code
  • 22. ROME April 11-12th 2014 - Gianfranco Reppucci A little bit of code
  • 23. ROME April 11-12th 2014 - Gianfranco Reppucci Object Oriented Go
  • 24. ROME April 11-12th 2014 - Gianfranco Reppucci A type declaration ! type Name struct {! ! ! First string! ! ! Middle string! ! ! Last string! ! }
  • 25. ROME April 11-12th 2014 - Gianfranco Reppucci A method declaration ! func (n Name) String() string {! ! ! return fmt.Sprintf(! ! ! ! “%s %c. %s”,! ! ! ! n.First,! ! ! ! n.Middle[0],! ! ! ! n.Last,! ! ! )! ! }
  • 26. ROME April 11-12th 2014 - Gianfranco Reppucci Instancing a Name ! aName := Name{“John”, “Go”, “White”}! ! ! fmt.Println(aName.String())
  • 27. ROME April 11-12th 2014 - Gianfranco Reppucci Goroutines
  • 28. ROME April 11-12th 2014 - Gianfranco Reppucci Given the yell function func yell(word string, seconds int) {! ! time.Sleep(time.Duration(seconds) * time.Second)! ! fmt.Println(word)! }
  • 29. ROME April 11-12th 2014 - Gianfranco Reppucci Guess what’s the output func main() {! ! go yell(“2014”, 5)! ! go yell(“Codemotion”, 1)! ! go yell(“Roma”, 4)! ! time.Sleep(10 * time.Second)! }
  • 30. ROME April 11-12th 2014 - Gianfranco Reppucci Channels
  • 31. ROME April 11-12th 2014 - Gianfranco Reppucci Channels • Implement parallelism and synchronization • Channels can be of any type of data structure, even custom structs • Can be buffered or unbuffered
  • 32. ROME April 11-12th 2014 - Gianfranco Reppucci An example c := make(chan int)! ! go func() {! ! list.Sort()! ! c <- 1! }()! ! doSomethingForAWhile()! <-c
  • 33. ROME April 11-12th 2014 - Gianfranco Reppucci Select statement
  • 34. ROME April 11-12th 2014 - Gianfranco Reppucci Select The select statement is like a switch, but
 it selects over channel operations and
 chooses exactly one of them
  • 35. ROME April 11-12th 2014 - Gianfranco Reppucci An example ticker := time.NewTicker(250 * time.Millisecond)! boom := time.After(1 * time.Second)! ! for {! ! select {! ! ! case <- ticker.C:! ! ! ! fmt.Println(“tick”)! ! ! case <- boom:! ! ! ! fmt.Println(“BOOM!”)! ! ! ! return! ! }! }
  • 36. ROME April 11-12th 2014 - Gianfranco Reppucci Start writing your
 Go code now Open your browser and point it to http://tour.golang.org for a quick tour, or http://play.golang.org to test your own snippets online
  • 37. ROME April 11-12th 2014 - Gianfranco Reppucci Why should I use Go? • Syntax and environments are similar to dynamic languages • Simple language specification • Powerful and lightweight
  • 38. ROME April 11-12th 2014 - Gianfranco Reppucci Why should I use Go? • Full development environment
 (doc, dependencies, formatter, tests) • Static compilation
 with NO dependencies binary output • Multi environment build
  • 39. ROME April 11-12th 2014 - Gianfranco Reppucci So, what’s Go about?
  • 40. ROME April 11-12th 2014 - Gianfranco Reppucci Composition • Go is Object Oriented,
 BUT not in the usual way! • Simple data models, simple interfaces
  • 41. ROME April 11-12th 2014 - Gianfranco Reppucci Concurrency • Easily readable concurrency primitives
  • 42. ROME April 11-12th 2014 - Gianfranco Reppucci Gophers
  • 43. ROME April 11-12th 2014 - Gianfranco Reppucci
  • 44. ROME April 11-12th 2014 - Gianfranco Reppucci Join us tonight GOLANGIT Meetup 18:40 - 19.40
  • 45. ROME April 11-12th 2014 - Gianfranco Reppucci Thank you! Gianfranco Reppucci giefferre
  • 46. ROME April 11-12th 2014 - Gianfranco Reppucci References • The gopher images were created by Renee French and they are Creative Commons Attribution 3.0 licensed • What technology should my startup use? by Matt Aimonetti • Go after four months by Graham King • Golang on Google’s App Engine
  • 47. ROME April 11-12th 2014 - Gianfranco Reppucci References • List of organizations that use Go • The gopher look, a photo by Ken Conley • How we went from 30 servers to 2 by Travis Reeder • Go after 2 years in production by Travis Reeder • Computer Language Benchmarks Game
  • 48. ROME April 11-12th 2014 - Gianfranco Reppucci References • Go at Google • Docker and Go: why did we decide to write docker in Go?