SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler offline
@marioggar
FUNCTIONAL PROGRAMMING
WITH
GROOVY
(Mario Garcia)
@marioggar
Who am I ?
● Software engineer at Kaleidos.net
● Groovy enthusiast
● Dublin GUG & Madrid GUG
desmontandojava.blogspot.com
@marioggar
https://github.com/mariogarcia
#FF9900
Mario García
@marioggar
What's functional programming ?
@marioggar
What's functional programming ?
“In computer science, functional programming is a programming paradigm, a style of building the structure and elements of
computer programs, that treats computation as the evaluation of mathematical functions and avoids state and mutable data.
Functional programming emphasizes functions that produce results that depend only on their inputs and not on the program state -
i.e. pure mathematical functions. It is a declarative programming paradigm, which means programming is done with
expressions. In functional code, the output value of a function depends only on the arguments that are input to the function, so
calling a function f twice with the same value for an argument x will produce the same result f(x) both times. Eliminating side
effects, i.e. changes in state that don't depend on the function inputs, can make it much easier to understand and predict the
behavior of a program, which is one of the key motivations for the development of functional programming...”
Wikipedia
(http://en.wikipedia.org/wiki/Functional_programming)
@marioggar
What's functional programming ?
@marioggar
@marioggar
Groovy is amazing!!!
@marioggar
@marioggar
Why FP matters ?
Aren't you tired of the same things ?
COPY / PASTE
REFACTORING IS HARD
PATTERNS REQUIRE TMC
FOR EACH
HOW TO OPEN/CLOSE A FILE
... NOT ENOUGH SPACE :(
@marioggar
Why FP matters ?
Tacking Accidental complexity
i.e: why I still should bother on how to loop through a data
structure
Modularity
“...higher-order functions and lazy evaluation, can
contribute greatly to modularity...” (John Hughes)
@marioggar
It's not about the language!!!!
● FP IS NOT ABOUT A LANGUAGE ONLY
● IS ABOUT THE WAY YOU USE YOURS
@marioggar
FP in the JVM
PURE FUNCTIONALFUNCTIONAL STYLE
You can You do
@marioggar
It's Groovy a functional language ?
● It's not a pure functional language but...
– Good news! You can do FP :-)
– I don't want to be pure anyway :P
– Let's see some code
@marioggar
It's imperative so bad ?
@marioggar
Would you keep using Java 1.4 ?
@marioggar
Is “imperative” so bad ?
No per se but:
• Most of the time it doesn't enforce you in the right direction
• Time to re-think on how we do things
• FP enables concurrency and parallel programming
Changing your programming paradigm is always a WIN:
• Most languages have at least a “functional style” of doing things
• Change your mind often...with some criteria of course ;)
@marioggar
@marioggar
THANKS !!!!
@marioggar
{ Q, A -> Q & A }

Mais conteúdo relacionado

Mais procurados

Introduction of programming tips site
Introduction of programming tips siteIntroduction of programming tips site
Introduction of programming tips siteRyosuke Miyahara
 
JavaCro 2016 - Testing with Spock: The Logical choice
JavaCro 2016 - Testing with Spock: The Logical choiceJavaCro 2016 - Testing with Spock: The Logical choice
JavaCro 2016 - Testing with Spock: The Logical choiceIván López Martín
 
Test driven development_and_puppet-cfgmgmtcamp_eu-20140402
Test driven development_and_puppet-cfgmgmtcamp_eu-20140402Test driven development_and_puppet-cfgmgmtcamp_eu-20140402
Test driven development_and_puppet-cfgmgmtcamp_eu-20140402Johan De Wit
 
Ready to Raid Questline Development
Ready to Raid Questline DevelopmentReady to Raid Questline Development
Ready to Raid Questline Developmentcenter4edupunx
 
RigaDevDay 2016 - Testing with Spock: The Logical Choice
RigaDevDay 2016 - Testing with Spock: The Logical ChoiceRigaDevDay 2016 - Testing with Spock: The Logical Choice
RigaDevDay 2016 - Testing with Spock: The Logical ChoiceIván López Martín
 
Codemotion Rome 2018 - Functional Java with Vavr
Codemotion Rome 2018 - Functional Java with VavrCodemotion Rome 2018 - Functional Java with Vavr
Codemotion Rome 2018 - Functional Java with VavrIván López Martín
 
Evolving as a QA - do you still care about quality?
Evolving as a QA - do you still care about quality?Evolving as a QA - do you still care about quality?
Evolving as a QA - do you still care about quality?Michał Krzyżanowski
 
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)Luis Rivera
 
Finding bugs in seconds brabant php
Finding bugs in seconds brabant phpFinding bugs in seconds brabant php
Finding bugs in seconds brabant phpGert de Pagter
 
Craate Your Own PHP Package - DILo Surabaya
Craate Your Own PHP Package - DILo SurabayaCraate Your Own PHP Package - DILo Surabaya
Craate Your Own PHP Package - DILo SurabayaDILo Surabaya
 
Idiomatic R for Rosetta Code (2013)
Idiomatic R for Rosetta Code (2013)Idiomatic R for Rosetta Code (2013)
Idiomatic R for Rosetta Code (2013)Peter Kofler
 
øredev 2017 - Test your Java applications with Spock
øredev 2017 - Test your Java applications with Spockøredev 2017 - Test your Java applications with Spock
øredev 2017 - Test your Java applications with SpockIván López Martín
 
Joomla!Day 2013 India
Joomla!Day 2013 IndiaJoomla!Day 2013 India
Joomla!Day 2013 IndiaOfer Cohen
 
Pre-Trained-Language-Models-for-NLU
Pre-Trained-Language-Models-for-NLUPre-Trained-Language-Models-for-NLU
Pre-Trained-Language-Models-for-NLUPOOJA BHOJWANI
 
GET / LDP/1.0; 500 Internal Server Error
GET / LDP/1.0; 500 Internal Server ErrorGET / LDP/1.0; 500 Internal Server Error
GET / LDP/1.0; 500 Internal Server ErrorSergio Fernández
 
GDCR15 in Las Palmas, Gran Canaria
GDCR15 in Las Palmas, Gran CanariaGDCR15 in Las Palmas, Gran Canaria
GDCR15 in Las Palmas, Gran CanariaPeter Kofler
 

Mais procurados (19)

Introduction of programming tips site
Introduction of programming tips siteIntroduction of programming tips site
Introduction of programming tips site
 
JavaCro 2016 - Testing with Spock: The Logical choice
JavaCro 2016 - Testing with Spock: The Logical choiceJavaCro 2016 - Testing with Spock: The Logical choice
JavaCro 2016 - Testing with Spock: The Logical choice
 
Test driven development_and_puppet-cfgmgmtcamp_eu-20140402
Test driven development_and_puppet-cfgmgmtcamp_eu-20140402Test driven development_and_puppet-cfgmgmtcamp_eu-20140402
Test driven development_and_puppet-cfgmgmtcamp_eu-20140402
 
Ready to Raid Questline Development
Ready to Raid Questline DevelopmentReady to Raid Questline Development
Ready to Raid Questline Development
 
RigaDevDay 2016 - Testing with Spock: The Logical Choice
RigaDevDay 2016 - Testing with Spock: The Logical ChoiceRigaDevDay 2016 - Testing with Spock: The Logical Choice
RigaDevDay 2016 - Testing with Spock: The Logical Choice
 
Codemotion Rome 2018 - Functional Java with Vavr
Codemotion Rome 2018 - Functional Java with VavrCodemotion Rome 2018 - Functional Java with Vavr
Codemotion Rome 2018 - Functional Java with Vavr
 
Evolving as a QA - do you still care about quality?
Evolving as a QA - do you still care about quality?Evolving as a QA - do you still care about quality?
Evolving as a QA - do you still care about quality?
 
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
 
Go lang
Go langGo lang
Go lang
 
Finding bugs in seconds brabant php
Finding bugs in seconds brabant phpFinding bugs in seconds brabant php
Finding bugs in seconds brabant php
 
Craate Your Own PHP Package - DILo Surabaya
Craate Your Own PHP Package - DILo SurabayaCraate Your Own PHP Package - DILo Surabaya
Craate Your Own PHP Package - DILo Surabaya
 
Idiomatic R for Rosetta Code (2013)
Idiomatic R for Rosetta Code (2013)Idiomatic R for Rosetta Code (2013)
Idiomatic R for Rosetta Code (2013)
 
øredev 2017 - Test your Java applications with Spock
øredev 2017 - Test your Java applications with Spockøredev 2017 - Test your Java applications with Spock
øredev 2017 - Test your Java applications with Spock
 
Joomla!Day 2013 India
Joomla!Day 2013 IndiaJoomla!Day 2013 India
Joomla!Day 2013 India
 
øredev 2017 - Vavr in Action
øredev 2017 - Vavr in Actionøredev 2017 - Vavr in Action
øredev 2017 - Vavr in Action
 
Pre-Trained-Language-Models-for-NLU
Pre-Trained-Language-Models-for-NLUPre-Trained-Language-Models-for-NLU
Pre-Trained-Language-Models-for-NLU
 
GET / LDP/1.0; 500 Internal Server Error
GET / LDP/1.0; 500 Internal Server ErrorGET / LDP/1.0; 500 Internal Server Error
GET / LDP/1.0; 500 Internal Server Error
 
GDCR15 in Las Palmas, Gran Canaria
GDCR15 in Las Palmas, Gran CanariaGDCR15 in Las Palmas, Gran Canaria
GDCR15 in Las Palmas, Gran Canaria
 
Concurrenry with Go
Concurrenry with GoConcurrenry with Go
Concurrenry with Go
 

Destaque

New feature of Groovy2.0 G*Workshop
New feature of Groovy2.0 G*WorkshopNew feature of Groovy2.0 G*Workshop
New feature of Groovy2.0 G*WorkshopUehara Junji
 
Groovy, State of the Union - Groovy Grails eXchange 2010 - Guillaume Laforge
Groovy, State of the Union - Groovy Grails eXchange 2010 - Guillaume LaforgeGroovy, State of the Union - Groovy Grails eXchange 2010 - Guillaume Laforge
Groovy, State of the Union - Groovy Grails eXchange 2010 - Guillaume LaforgeGuillaume Laforge
 
groovy 2.1.0 20130118
groovy 2.1.0 20130118groovy 2.1.0 20130118
groovy 2.1.0 20130118Uehara Junji
 
Macro macro, burrito burrit
Macro macro, burrito burritMacro macro, burrito burrit
Macro macro, burrito burritMario García
 
SIROK技術勉強会 #1 「Reactってなんだ?」
SIROK技術勉強会 #1 「Reactってなんだ?」SIROK技術勉強会 #1 「Reactってなんだ?」
SIROK技術勉強会 #1 「Reactってなんだ?」Naoyuki Kataoka
 

Destaque (8)

Vert.x.tari.tari
Vert.x.tari.tariVert.x.tari.tari
Vert.x.tari.tari
 
New feature of Groovy2.0 G*Workshop
New feature of Groovy2.0 G*WorkshopNew feature of Groovy2.0 G*Workshop
New feature of Groovy2.0 G*Workshop
 
Groovy, State of the Union - Groovy Grails eXchange 2010 - Guillaume Laforge
Groovy, State of the Union - Groovy Grails eXchange 2010 - Guillaume LaforgeGroovy, State of the Union - Groovy Grails eXchange 2010 - Guillaume Laforge
Groovy, State of the Union - Groovy Grails eXchange 2010 - Guillaume Laforge
 
groovy 2.1.0 20130118
groovy 2.1.0 20130118groovy 2.1.0 20130118
groovy 2.1.0 20130118
 
Android on Groovy
Android on GroovyAndroid on Groovy
Android on Groovy
 
Groovy android
Groovy androidGroovy android
Groovy android
 
Macro macro, burrito burrit
Macro macro, burrito burritMacro macro, burrito burrit
Macro macro, burrito burrit
 
SIROK技術勉強会 #1 「Reactってなんだ?」
SIROK技術勉強会 #1 「Reactってなんだ?」SIROK技術勉強会 #1 「Reactってなんだ?」
SIROK技術勉強会 #1 「Reactってなんだ?」
 

Semelhante a Functional Programming with Groovy

Go language presentation
Go language presentationGo language presentation
Go language presentationparamisoft
 
Daniel Steigerwald: WYSIWYG je šik! (když funguje)
Daniel Steigerwald: WYSIWYG je šik! (když funguje)Daniel Steigerwald: WYSIWYG je šik! (když funguje)
Daniel Steigerwald: WYSIWYG je šik! (když funguje)Develcz
 
Advantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksAdvantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksKaty Slemon
 
F# for BLOBA, by brandon d'imperio
F# for BLOBA, by brandon d'imperioF# for BLOBA, by brandon d'imperio
F# for BLOBA, by brandon d'imperioMaslowB
 
Improving the developer experience on OpenShift - devconf-india-18
Improving the developer experience on OpenShift - devconf-india-18Improving the developer experience on OpenShift - devconf-india-18
Improving the developer experience on OpenShift - devconf-india-18Jorge Morales
 
Golang from Scala developer’s perspective
Golang from Scala developer’s perspectiveGolang from Scala developer’s perspective
Golang from Scala developer’s perspectiveSveta Bozhko
 
A sip of elixir
A sip of elixirA sip of elixir
A sip of elixirUttam Kini
 
Using twig as rendering system for your Joomla extensions
Using twig as rendering system for your Joomla extensionsUsing twig as rendering system for your Joomla extensions
Using twig as rendering system for your Joomla extensionsRoberto Segura
 
Getting Started with Scripts #HeroConf London 2015
Getting Started with Scripts #HeroConf London 2015Getting Started with Scripts #HeroConf London 2015
Getting Started with Scripts #HeroConf London 2015Amy Bishop
 
Final requirement for programming-Bonifacio, Mary Clemence
Final requirement for programming-Bonifacio, Mary ClemenceFinal requirement for programming-Bonifacio, Mary Clemence
Final requirement for programming-Bonifacio, Mary Clemenceclemencebonifacio
 
go language- haseeb.pptx
go language- haseeb.pptxgo language- haseeb.pptx
go language- haseeb.pptxArsalanMaqsood1
 
Automating with operators - FossAsia Summit 2019
Automating with operators - FossAsia Summit 2019Automating with operators - FossAsia Summit 2019
Automating with operators - FossAsia Summit 2019Jorge Morales
 
Introduction to Large Language Models and the Transformer Architecture.pdf
Introduction to Large Language Models and the Transformer Architecture.pdfIntroduction to Large Language Models and the Transformer Architecture.pdf
Introduction to Large Language Models and the Transformer Architecture.pdfsudeshnakundu10
 
Python in real world.
Python in real world.Python in real world.
Python in real world.Alph@.M
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own languageAndrea Tino
 
Go/Ruby/Java: What's next?
Go/Ruby/Java: What's next?Go/Ruby/Java: What's next?
Go/Ruby/Java: What's next?Hernan Wilkinson
 

Semelhante a Functional Programming with Groovy (20)

Go language presentation
Go language presentationGo language presentation
Go language presentation
 
Daniel Steigerwald: WYSIWYG je šik! (když funguje)
Daniel Steigerwald: WYSIWYG je šik! (když funguje)Daniel Steigerwald: WYSIWYG je šik! (když funguje)
Daniel Steigerwald: WYSIWYG je šik! (když funguje)
 
Advantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksAdvantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworks
 
F# for BLOBA, by brandon d'imperio
F# for BLOBA, by brandon d'imperioF# for BLOBA, by brandon d'imperio
F# for BLOBA, by brandon d'imperio
 
Learning to code in 2020
Learning to code in 2020Learning to code in 2020
Learning to code in 2020
 
Improving the developer experience on OpenShift - devconf-india-18
Improving the developer experience on OpenShift - devconf-india-18Improving the developer experience on OpenShift - devconf-india-18
Improving the developer experience on OpenShift - devconf-india-18
 
Golang from Scala developer’s perspective
Golang from Scala developer’s perspectiveGolang from Scala developer’s perspective
Golang from Scala developer’s perspective
 
A sip of elixir
A sip of elixirA sip of elixir
A sip of elixir
 
Go fundamentals
Go fundamentalsGo fundamentals
Go fundamentals
 
Using twig as rendering system for your Joomla extensions
Using twig as rendering system for your Joomla extensionsUsing twig as rendering system for your Joomla extensions
Using twig as rendering system for your Joomla extensions
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
Getting Started with Scripts #HeroConf London 2015
Getting Started with Scripts #HeroConf London 2015Getting Started with Scripts #HeroConf London 2015
Getting Started with Scripts #HeroConf London 2015
 
Final requirement for programming-Bonifacio, Mary Clemence
Final requirement for programming-Bonifacio, Mary ClemenceFinal requirement for programming-Bonifacio, Mary Clemence
Final requirement for programming-Bonifacio, Mary Clemence
 
go language- haseeb.pptx
go language- haseeb.pptxgo language- haseeb.pptx
go language- haseeb.pptx
 
Automating with operators - FossAsia Summit 2019
Automating with operators - FossAsia Summit 2019Automating with operators - FossAsia Summit 2019
Automating with operators - FossAsia Summit 2019
 
Introduction to Large Language Models and the Transformer Architecture.pdf
Introduction to Large Language Models and the Transformer Architecture.pdfIntroduction to Large Language Models and the Transformer Architecture.pdf
Introduction to Large Language Models and the Transformer Architecture.pdf
 
Python in real world.
Python in real world.Python in real world.
Python in real world.
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own language
 
Go/Ruby/Java: What's next?
Go/Ruby/Java: What's next?Go/Ruby/Java: What's next?
Go/Ruby/Java: What's next?
 
Introductoin to Python.ppt
Introductoin to Python.pptIntroductoin to Python.ppt
Introductoin to Python.ppt
 

Mais de Mario García

Blockchain 101 (spanish)
Blockchain 101 (spanish)Blockchain 101 (spanish)
Blockchain 101 (spanish)Mario García
 
Jbake workshop (Greach 2019)
Jbake workshop (Greach 2019)Jbake workshop (Greach 2019)
Jbake workshop (Greach 2019)Mario García
 
Groovy 2.5 and 3.0 (Spanish)
Groovy 2.5 and 3.0 (Spanish)Groovy 2.5 and 3.0 (Spanish)
Groovy 2.5 and 3.0 (Spanish)Mario García
 
Calidad del codigo (MadridGUG)
Calidad del codigo (MadridGUG)Calidad del codigo (MadridGUG)
Calidad del codigo (MadridGUG)Mario García
 
Creating ASTTs The painful truth
Creating ASTTs The painful truthCreating ASTTs The painful truth
Creating ASTTs The painful truthMario García
 
Test Motherfucker...Test
Test Motherfucker...TestTest Motherfucker...Test
Test Motherfucker...TestMario García
 
Programación concurrente con GPars
Programación concurrente con GParsProgramación concurrente con GPars
Programación concurrente con GParsMario García
 
Greach 2011 : Creando Plugins Con Griffon
Greach 2011 : Creando Plugins Con GriffonGreach 2011 : Creando Plugins Con Griffon
Greach 2011 : Creando Plugins Con GriffonMario García
 

Mais de Mario García (13)

Blockchain 101 (spanish)
Blockchain 101 (spanish)Blockchain 101 (spanish)
Blockchain 101 (spanish)
 
Jbake workshop (Greach 2019)
Jbake workshop (Greach 2019)Jbake workshop (Greach 2019)
Jbake workshop (Greach 2019)
 
Groovy 2.5 and 3.0 (Spanish)
Groovy 2.5 and 3.0 (Spanish)Groovy 2.5 and 3.0 (Spanish)
Groovy 2.5 and 3.0 (Spanish)
 
GraphQL & Ratpack
GraphQL & RatpackGraphQL & Ratpack
GraphQL & Ratpack
 
GraphQL y Groovy
GraphQL y GroovyGraphQL y Groovy
GraphQL y Groovy
 
Calidad del codigo (MadridGUG)
Calidad del codigo (MadridGUG)Calidad del codigo (MadridGUG)
Calidad del codigo (MadridGUG)
 
GraphQL and Groovy
GraphQL and GroovyGraphQL and Groovy
GraphQL and Groovy
 
Creating ASTTs The painful truth
Creating ASTTs The painful truthCreating ASTTs The painful truth
Creating ASTTs The painful truth
 
Groovy on Android
Groovy on AndroidGroovy on Android
Groovy on Android
 
Test Motherfucker...Test
Test Motherfucker...TestTest Motherfucker...Test
Test Motherfucker...Test
 
Programación concurrente con GPars
Programación concurrente con GParsProgramación concurrente con GPars
Programación concurrente con GPars
 
Gradle vs Maven
Gradle vs MavenGradle vs Maven
Gradle vs Maven
 
Greach 2011 : Creando Plugins Con Griffon
Greach 2011 : Creando Plugins Con GriffonGreach 2011 : Creando Plugins Con Griffon
Greach 2011 : Creando Plugins Con Griffon
 

Último

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 

Último (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 

Functional Programming with Groovy

  • 2. @marioggar Who am I ? ● Software engineer at Kaleidos.net ● Groovy enthusiast ● Dublin GUG & Madrid GUG desmontandojava.blogspot.com @marioggar https://github.com/mariogarcia #FF9900 Mario García
  • 4. @marioggar What's functional programming ? “In computer science, functional programming is a programming paradigm, a style of building the structure and elements of computer programs, that treats computation as the evaluation of mathematical functions and avoids state and mutable data. Functional programming emphasizes functions that produce results that depend only on their inputs and not on the program state - i.e. pure mathematical functions. It is a declarative programming paradigm, which means programming is done with expressions. In functional code, the output value of a function depends only on the arguments that are input to the function, so calling a function f twice with the same value for an argument x will produce the same result f(x) both times. Eliminating side effects, i.e. changes in state that don't depend on the function inputs, can make it much easier to understand and predict the behavior of a program, which is one of the key motivations for the development of functional programming...” Wikipedia (http://en.wikipedia.org/wiki/Functional_programming)
  • 9. @marioggar Why FP matters ? Aren't you tired of the same things ? COPY / PASTE REFACTORING IS HARD PATTERNS REQUIRE TMC FOR EACH HOW TO OPEN/CLOSE A FILE ... NOT ENOUGH SPACE :(
  • 10. @marioggar Why FP matters ? Tacking Accidental complexity i.e: why I still should bother on how to loop through a data structure Modularity “...higher-order functions and lazy evaluation, can contribute greatly to modularity...” (John Hughes)
  • 11. @marioggar It's not about the language!!!! ● FP IS NOT ABOUT A LANGUAGE ONLY ● IS ABOUT THE WAY YOU USE YOURS
  • 12. @marioggar FP in the JVM PURE FUNCTIONALFUNCTIONAL STYLE You can You do
  • 13. @marioggar It's Groovy a functional language ? ● It's not a pure functional language but... – Good news! You can do FP :-) – I don't want to be pure anyway :P – Let's see some code
  • 15. @marioggar Would you keep using Java 1.4 ?
  • 16. @marioggar Is “imperative” so bad ? No per se but: • Most of the time it doesn't enforce you in the right direction • Time to re-think on how we do things • FP enables concurrency and parallel programming Changing your programming paradigm is always a WIN: • Most languages have at least a “functional style” of doing things • Change your mind often...with some criteria of course ;)
  • 19. @marioggar { Q, A -> Q & A }