SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
@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 }

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 

Andere mochten auch (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ってなんだ?」
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 

Kürzlich hochgeladen (20)

Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 

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 }