Slide 1

Slide 1 text

Why use #groovylang? How to convince your boss and others Jenn Strater @codeJENNerator @zenjobcom

Slide 2

Slide 2 text

@codeJENNerator Note For Those Viewing Slides Online • Bulleted text like this indicates the key points mentioned on a previous slide. They may not have been included in the official presentation. • Not every slide was in the presentation. There is more content then time so some are skipped at some conferences. • If this view does not support links, the links will work in the pdf. Click the ‘download pdf’ button on the right.

Slide 3

Slide 3 text

@codeJENNerator Follow Along https://speakerdeck.com/jlstrater/why-groovy-gr8conf-2018

Slide 4

Slide 4 text

Follow Along https://speakerdeck.com/jlstrater/test-driven-docs-springone-2017 https://github.com/jlstrater/groovy-spring-boot-restdocs-example https://github.com/ratpack/example-books https://github.com/jlstrater/spring-restdocs-public-api-example

Slide 5

Slide 5 text

Follow Along https://speakerdeck.com/jlstrater/test-driven-docs-springone-2017 https://github.com/jlstrater/groovy-spring-boot-restdocs-example https://github.com/ratpack/example-books https://github.com/jlstrater/spring-restdocs-public-api-example

Slide 6

Slide 6 text

@codeJENNerator About Me - Working at Zenjob. - Groovy (mostly Grails) user since 2013. - Before moving to Berlin, I spent a year in Copenhagen. - Before that, I was senior consultant at Object Partners, Inc. in Minneapolis, MN, USA. - Co-founder of Gr8Ladies (deprecated) - Passionate about bring new people into the Groovy community through free introductory workshops called Gr8Workshops and supporting underrepresented minorities and their careers in tech.

Slide 7

Slide 7 text

@codeJENNerator Audience Background

Slide 8

Slide 8 text

@codeJENNerator Audience Background • Groovy • Everyday user • Side project user • New to Groovy

Slide 9

Slide 9 text

@codeJENNerator Audience Background • Groovy • Everyday user • Side project user • New to Groovy

Slide 10

Slide 10 text

@codeJENNerator Audience Background • Groovy • Everyday user • Side project user • New to Groovy • Frameworks / Tools • Grails • Spock • Gradle • Griffon • Jenkins

Slide 11

Slide 11 text

@codeJENNerator –Andres Almiray @aalmiary “Groovy developers don’t seem to care about hype, they simply get the job done.”

Slide 12

Slide 12 text

@codeJENNerator Outline • Why use Groovy? • Truth or Myth? • Ways to Start Using Groovy Today!

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

@codeJENNerator Features

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

@codeJENNerator Ecosystem

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

@codeJENNerator Community

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

@codeJENNerator http://bit.ly/groovy-word-cloud

Slide 34

Slide 34 text

@codeJENNerator Groovy is awesome because… • Great features • Thriving ecosystem • Friendly community

Slide 35

Slide 35 text

@codeJENNerator

Slide 36

Slide 36 text

@codeJENNerator Truth or Myth?

Slide 37

Slide 37 text

@codeJENNerator • After spending some time at Java User Groups, Conferences, and reading lots of stuff online, I realized that there are a lot of things people get wrong about Groovy or that just aren’t true in the most recent versions. • All of these assumptions are things are related to conversations I’ve had with real people at some point in my career.

Slide 38

Slide 38 text

@codeJENNerator Groovy is the same thing as Grails

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

@codeJENNerator • Groovy is a language and can be used independently or in many different frameworks including: • Grails • Griffon • Gaelyk • Spock • Ratpack • Vertx • And many more!

Slide 41

Slide 41 text

@codeJENNerator Groovy is just a scripting language

Slide 42

Slide 42 text

@codeJENNerator Yes and No

Slide 43

Slide 43 text

@codeJENNerator • Groovy CAN BE used for scripting, but it’s NOT ONLY a scripting language. It can also be used in OOP and functional projects too.

Slide 44

Slide 44 text

@codeJENNerator James Strachan, the creator of Groovy, has left the community

Slide 45

Slide 45 text

@codeJENNerator James Strachan, the creator of Groovy, has left the community

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

@codeJENNerator • 2009 http://macstrac.blogspot.de/2009/04/scala-as-long- term-replacement-for.html • 2017 https://medium.com/@jstrachan/fwiw-i-still-use- groovy-most-days-thanks-to-jenkins-pipelines-along-with- java-typescript-ef5f8b05acbe

Slide 48

Slide 48 text

@codeJENNerator 4. Groovy’s dynamic nature can mean more runtime errors

Slide 49

Slide 49 text

@codeJENNerator

Slide 50

Slide 50 text

@codeJENNerator But…

Slide 51

Slide 51 text

@codeJENNerator

Slide 52

Slide 52 text

@codeJENNerator • We protect against runtime errors with good practices like static analysis tools (think Codenarc), code reviews, writing comprehensive tests, and learning about common pitfalls and mistakes made in Groovy (like reading blogs and going to conferences) • Moving execution of code to runtime isn’t always bad, sometimes adding null-safes can protect against NPEs.

Slide 53

Slide 53 text

From Iván Lopez’s “ I've seen Grails code you wouldn't believe…” at Greach 2018 Slides

Slide 54

Slide 54 text

@codeJENNerator Groovy is a dynamically typed language

Slide 55

Slide 55 text

@codeJENNerator Not really

Slide 56

Slide 56 text

@codeJENNerator • Groovy is OPTIONALLY typed. Def can be used when a type is flexible, but unlike some other languages, declaring def x = 3 followed by x = ‘hello’ is totally valid Groovy. • Also, using static compilation (vs the default dynamic compilation) makes a difference in what behaviors are allowed. • Groovy is called dynamic language not because of typing but because of the dynamic features including runtime metaprogramming. • For a really good explanation of the Groovy type system, read Groovy in Action 2nd Edition!

Slide 57

Slide 57 text

@codeJENNerator Groovy is not suitable for production apps

Slide 58

Slide 58 text

@codeJENNerator Not really

Slide 59

Slide 59 text

@codeJENNerator

Slide 60

Slide 60 text

@codeJENNerator Groovy is slow

Slide 61

Slide 61 text

@codeJENNerator

Slide 62

Slide 62 text

@codeJENNerator It depends!

Slide 63

Slide 63 text

@codeJENNerator • It’s true that Groovy is slower than optimal Java, but not by as much as most people think.

Slide 64

Slide 64 text

@codeJENNerator • It mainly depends on what you write. For example, some improperly used looping methods may be slower than the Java counterpart. • Compilation also matters. Statically compiled Groovy code can run almost as fast as well-written Java code. However, dynamic Groovy isn’t that much slower (if written with performance in mind). • Consider reading https://www.linkedin.com/pulse/ how-make-groovy-fast-java-david-e-jones/ for more info.

Slide 65

Slide 65 text

@codeJENNerator 8. Gradle is switching to Kotlin because Groovy sucks.

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

@codeJENNerator • Gradle needed some major reworking. Not because of Groovy itself but because of how they implemented the DSL (hindsight is always 20/20!) • Kotlin solves issues that many end users (especially Android devs) have with Gradle including poor IntelliJ support and the fact that many people don’t know Groovy. I’ve seen so many people use it without really knowing the best practices resulting in horrible builds. That’s not really the fault of Groovy or Gradle, but . • Gradle could have been reworked to support Groovy better, but for now, Kotlin makes more sense. • Also, Groovy support is not going away! Kotlin is just being added (with maybe some extra enhancements). • Mostly from my own experience and http://melix.github.io/blog/2016/05/ gradle-kotlin.html

Slide 68

Slide 68 text

@codeJENNerator You can write a project entirely in statically compiled Groovy

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

@codeJENNerator • If you find yourself forgetting to add @CompileStatic at the top of every file in your groovy code, you can set compiler options using Gradle and it will apply static compilation to every file in your source directory. • https://stackoverflow.com/a/30307025/2250125

Slide 71

Slide 71 text

@codeJENNerator Grails is Rails for the JVM

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

@codeJENNerator • Although Grails originally started as a Rails like MVC framework for the JVM, it has since very much diverged from Ruby on Rails. Grails is not just for monoliths but the profile system can be used for many different types of applications. Grails 3.0 is also heavy reliant on Spring Boot and goes even further in that direction.

Slide 74

Slide 74 text

@codeJENNerator Groovy is dead

Slide 75

Slide 75 text

@codeJENNerator

Slide 76

Slide 76 text

@codeJENNerator Groovy Downloads in Thousands 0 1500 3000 4500 6000 January 2012 July 2012 January 2013 July 2013 January 2014 July 2014 January 2015 July 2015 January 2016 July 2016 January 2017 July 2017 Codehaus Bintray Maven Central

Slide 77

Slide 77 text

@codeJENNerator Groovy Downloads in Thousands 0 1500 3000 4500 6000 January 2012 July 2012 January 2013 July 2013 January 2014 July 2014 January 2015 July 2015 January 2016 July 2016 January 2017 July 2017 Codehaus Bintray Maven Central End of Pivotal Support

Slide 78

Slide 78 text

@codeJENNerator Groovy Downloads in Thousands 0 1500 3000 4500 6000 January 2012 July 2012 January 2013 July 2013 January 2014 July 2014 January 2015 July 2015 January 2016 July 2016 January 2017 July 2017 Codehaus Bintray Maven Central End of Pivotal Support Gradle Kotlin Announcement

Slide 79

Slide 79 text

@codeJENNerator Groovy Downloads in Thousands 0 1500 3000 4500 6000 January 2012 July 2012 January 2013 July 2013 January 2014 July 2014 January 2015 July 2015 January 2016 July 2016 January 2017 July 2017 Codehaus Bintray Maven Central End of Pivotal Support Gradle Kotlin Announcement ???

Slide 80

Slide 80 text

source: bintray

Slide 81

Slide 81 text

source: bintray

Slide 82

Slide 82 text

@codeJENNerator • Groovy downloads are up and higher than any time under Pivotal • In the last few years under Apache, Groovy has added many new contributors from various companies and individuals all over the world. • Although there is no single company is sponsoring the language, companies like OCI sponsor developers at least part-time.

Slide 83

Slide 83 text

@codeJENNerator • Groovy releases are more frequent than in a long time. • Improvements coming in 2.5 including macros and 2.6/3.0 with the parrot parser will majorly change Groovy for the better. Most of the work on the parrot parser comes from a new committer, Daniel Sun! • OCI’s support of the Grails framework means several people are dedicated to it and releases are frankly coming out faster than I can keep up.

Slide 84

Slide 84 text

@codeJENNerator use code ctwgr8eu18

Slide 85

Slide 85 text

@codeJENNerator

Slide 86

Slide 86 text

@codeJENNerator Adding Groovy to your organization

Slide 87

Slide 87 text

@codeJENNerator See if you are already using Groovy • Jenkins (Pipeline, Jobs Plugin, and many more!) • Spring Boot (optional Groovy support) • Apache Spark • SoapUI • JMeter • Tinkerpop (Gremlin) • Oracle NoSQL Database • Elasticsearch (deprecated)

Slide 88

Slide 88 text

@codeJENNerator Spock • Groovy can be used in tests, but not in the end product if you don’t need it. • Once you start using Spock, you can add other awesome tools like Get and Test Containers

Slide 89

Slide 89 text

@codeJENNerator Try a small POC • Frameworks like Grails are great for trying something out. If the team gets used to using Groovy for small projects, it might be easier to use it in more places later.

Slide 90

Slide 90 text

@codeJENNerator Get Connected • Subscribe to the groovy users mailing list • Join the Groovy Community on Slack groovycommunity.com or sign-in again at groovy- community.slack.com • Contribute by writing documentation or fixing bugs. • Attend conferences like GR8Conf EU 2018. • Join Zenjob!

Slide 91

Slide 91 text

@codeJENNerator Conclusion

Slide 92

Slide 92 text

@codeJENNerator

Slide 93

Slide 93 text

@codeJENNerator • Groovy is a fun language with a great community!

Slide 94

Slide 94 text

@codeJENNerator • Groovy is a fun language with a great community! • You can use Groovy in many different ways!

Slide 95

Slide 95 text

@codeJENNerator • Groovy is a fun language with a great community! • You can use Groovy in many different ways! • It isn’t an all-or-nothing solution. You can start small.

Slide 96

Slide 96 text

@codeJENNerator • Groovy is a fun language with a great community! • You can use Groovy in many different ways! • It isn’t an all-or-nothing solution. You can start small. • Start talking about Groovy with your boss and coworkers and make sure they don’t keep spreading the Groovy myths. Keep them on the Groovy truth.

Slide 97

Slide 97 text

@codeJENNerator • Groovy is a fun language with a great community! • You can use Groovy in many different ways! • It isn’t an all-or-nothing solution. You can start small. • Start talking about Groovy with your boss and coworkers and make sure they don’t keep spreading the Groovy myths. Keep them on the Groovy truth. • Rather than talking bad about problems with Apache Groovy, contribute! Anyone can shape the future.

Slide 98

Slide 98 text

@codeJENNerator Feedback • Rate this talk: https://gr8conf.eu/talks • Send me new Groovy Truth of Myths

Slide 99

Slide 99 text

@codeJENNerator Questions? https://flic.kr/p/5DeuzB