Groovy brownbag

Post on 30-Nov-2014

392 views 3 download

description

Slides for a brown-bag on the Groovy programming language. The talk was given on 11/7/2011.

Transcript of Groovy brownbag

WHY GROOVY IS SOAWESOME

Chris Trevino

“Using a computer requires a fair amount of ritual and ceremony…The less you interact with your computer, the faster you can go. In other words, eliminating ceremony allows you to get to the essence of the problem.”

Neal Ford – The Productive Programmer

About Groovy

• Object-oriented• Dynamically Typed• Can use all Java libraries• Feels a lot like Java• Can be compiled or interpreted

Groovy Learning Curve

Most Java is valid Groovy

Steps to Start Using Groovy

1) Install eclipse plugin2) Add groovy nature3) Rename .java file .groovy

AWESOMETHINGS

Semicolons are Optional

Semicolons are Optional

; =

‘public’ is Optional

‘public’ is Optional

You don’t use package protected anyway

You don’t use package protected anyway

(@PackageScope annotation is available if you do)

‘.class’ is Optional

‘.class’ is Optional

Getters and Setters are Optional

Getters and Setters are Optional

Getters and Setters are Optional

get..() and set..() are Optional

λ

λ

Lamdba Expressions

AWESOMENESSSO FAR

MOREAWESOMETHINGS

Cleaned up Imports

Cleaned up Imports

Type Declarations are Optional

‘return’ is Optional

Streamlined Lists

Streamlined Lists

Streamlined Maps

Streamlined Maps

Streamlined Bean Instantiation

Safe Traversal

Elvis

LIST COMPREHENSIONS

G-Strings

Native Regex Support

Match: ==~ Find: =~

Easy File I/O

Easy Markup

Missing Method/Property Handling

Categories / Extension Methods

Extension methods with metaClass

Type Renaming

Hella Dynamic

Hella Dynamic

F***ING AWESOME!!!one!

Hella Static

Groovy++ =>

F***ING AWESOME!!!one!

GROOVY PLAYS NICE