SlideShare a Scribd company logo
Groovy vs Java




             NOV 2011
The real battle is static vs dynamic
typing
In other words:

 ● Static :
   The type of each variable (or expression) must be known
   at compile time.


 ● Dynamic:
Type information is known only at runtime.
Which are their super powers ?
  ● Static Typing
–Errors are often detected earlier and with better error messages
–Better IDE support
–Better optimisations are often possible


  ● Dynamic Typing
–Speeds up development through duck-typing
–Allows more expressiveness through DSLs
We choose the dynamic way
Many of the rules and patterns we have been taught no longer
apply

 1. Patterns to review
     ○ Singleton
     ○ Resources
     ○ Delegation
     ○ ...

 2. Performace
     ○ Java always wins ?
     ○ We need win ?
DEMOS

What are you doing?

Let's go to see CODE !!!

https://github.com/pablomoretti/ppt-groovy-vs-java
Lessons 
● Testing the Duck:
  Used when flexibility is important, but it has appropriate tests in place.

● Static Typing isn't the bad guy of the movie:
  Used when we know that code doesn´t need to be dynamic; typing
  is useful to shed some light on code.

● Interface-oriented design:
  The use of interfaces is not necessary, but they are useful.

● Performance:
  In Groovy, the sensitive parts can always be written in Java
Questions ?




              @elsantob

More Related Content

PPTX
Introduction to go lang
PPT
Dynamic Languages on the JVM
PPT
Groovy introduction
PDF
Java & JavaScript: Best Friends?
PPTX
Typescript kata The TDD style 2 edition
PDF
Professional JavaScript Development (An Introduction for Java Developers)
PDF
PPT
TypeScript - Javascript done right
Introduction to go lang
Dynamic Languages on the JVM
Groovy introduction
Java & JavaScript: Best Friends?
Typescript kata The TDD style 2 edition
Professional JavaScript Development (An Introduction for Java Developers)
TypeScript - Javascript done right

What's hot (20)

PDF
Venkat Subramaniam Blending Java With Dynamic Languages
PDF
Venkat Subramaniam Building DSLs In Groovy
PPTX
PDF
Groovy android
PPTX
PDF
Test-Driven Development with TypeScript+Jasmine+AngularJS
PPTX
Java introduction
PDF
Java introduction
PPTX
Java (1)
PDF
Why you should care about Go (Golang)
PDF
History of Java 2/2
PDF
There is something about JavaScript - Choose Forum 2014
ODP
eXo EC - Groovy Programming Language
PPTX
Unit Testing TypeScript
PDF
Buildr - build like you code
PDF
Modularity problems
PDF
The Go programming language - Intro by MyLittleAdventure
PPTX
ATO 2014 - So You Think You Know 'Go'? The Go Programming Language
PDF
Spring-batch Groovy y Gradle
PDF
History of java
Venkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Building DSLs In Groovy
Groovy android
Test-Driven Development with TypeScript+Jasmine+AngularJS
Java introduction
Java introduction
Java (1)
Why you should care about Go (Golang)
History of Java 2/2
There is something about JavaScript - Choose Forum 2014
eXo EC - Groovy Programming Language
Unit Testing TypeScript
Buildr - build like you code
Modularity problems
The Go programming language - Intro by MyLittleAdventure
ATO 2014 - So You Think You Know 'Go'? The Go Programming Language
Spring-batch Groovy y Gradle
History of java
Ad

Similar to Groovy & Java (20)

ODP
Xtreme Programming
PPTX
Running Neo4j in Production: Tips, Tricks and Optimizations
PPTX
Running Neo4j in Production: Tips, Tricks and Optimizations
PDF
Best practices for JavaScript RIAs
PDF
Making Strongly-typed NETCONF Usable
PDF
Grooming with Groovy
PDF
What do we really know about the differences between static and dynamic types?
PDF
TDD in Python With Pytest
PPTX
Cinci ug-january2011-anti-patterns
PDF
Effective entrepreneurship for developers
PDF
From Objective-C to Swift
PPTX
Polar talks: code generation
PPTX
Developing Better Software
PPTX
Security Testing for Containerized Applications
PPTX
DevSecCon Tel Aviv 2018 - Security Testing for Containerised Apps by Omer Levi
PDF
Modern Messaging for Distributed Systems
PPTX
A sip of elixir
PDF
The Final Frontier, Automating Dynamic Security Testing
PDF
Working With Legacy Code
PPTX
Creating a reasonable project boilerplate
Xtreme Programming
Running Neo4j in Production: Tips, Tricks and Optimizations
Running Neo4j in Production: Tips, Tricks and Optimizations
Best practices for JavaScript RIAs
Making Strongly-typed NETCONF Usable
Grooming with Groovy
What do we really know about the differences between static and dynamic types?
TDD in Python With Pytest
Cinci ug-january2011-anti-patterns
Effective entrepreneurship for developers
From Objective-C to Swift
Polar talks: code generation
Developing Better Software
Security Testing for Containerized Applications
DevSecCon Tel Aviv 2018 - Security Testing for Containerised Apps by Omer Levi
Modern Messaging for Distributed Systems
A sip of elixir
The Final Frontier, Automating Dynamic Security Testing
Working With Legacy Code
Creating a reasonable project boilerplate
Ad

More from Pablo Moretti (7)

PDF
Scaling with Microservice
PDF
Web performance optimization - MercadoLibre
PDF
Mobiledevcon - MercadoLibre web mobile
PDF
Breaking performance web rules
PDF
Demanda - MercadoLivre Developers Conference
PDF
Mercado Libre - Introducción a SEO
PDF
Efficiently downloading and executing Javascript
Scaling with Microservice
Web performance optimization - MercadoLibre
Mobiledevcon - MercadoLibre web mobile
Breaking performance web rules
Demanda - MercadoLivre Developers Conference
Mercado Libre - Introducción a SEO
Efficiently downloading and executing Javascript

Recently uploaded (20)

PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
KodekX | Application Modernization Development
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Encapsulation theory and applications.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Understanding_Digital_Forensics_Presentation.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
MIND Revenue Release Quarter 2 2025 Press Release
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
The Rise and Fall of 3GPP – Time for a Sabbatical?
The AUB Centre for AI in Media Proposal.docx
Digital-Transformation-Roadmap-for-Companies.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
KodekX | Application Modernization Development
MYSQL Presentation for SQL database connectivity
Programs and apps: productivity, graphics, security and other tools
Encapsulation theory and applications.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Building Integrated photovoltaic BIPV_UPV.pdf

Groovy & Java

  • 1. Groovy vs Java NOV 2011
  • 2. The real battle is static vs dynamic typing In other words: ● Static : The type of each variable (or expression) must be known at compile time. ● Dynamic: Type information is known only at runtime.
  • 3. Which are their super powers ? ● Static Typing –Errors are often detected earlier and with better error messages –Better IDE support –Better optimisations are often possible ● Dynamic Typing –Speeds up development through duck-typing –Allows more expressiveness through DSLs
  • 4. We choose the dynamic way Many of the rules and patterns we have been taught no longer apply 1. Patterns to review ○ Singleton ○ Resources ○ Delegation ○ ... 2. Performace ○ Java always wins ? ○ We need win ?
  • 5. DEMOS What are you doing? Let's go to see CODE !!! https://github.com/pablomoretti/ppt-groovy-vs-java
  • 6. Lessons  ● Testing the Duck: Used when flexibility is important, but it has appropriate tests in place. ● Static Typing isn't the bad guy of the movie: Used when we know that code doesn´t need to be dynamic; typing is useful to shed some light on code. ● Interface-oriented design: The use of interfaces is not necessary, but they are useful. ● Performance: In Groovy, the sensitive parts can always be written in Java
  • 7. Questions ? @elsantob