exercism/groovy

What was it like to learn Groovy?

Closed this issue · 2 comments

We’ve recently started a project to find the best way to design our tracks, in order to optimize the learning experience of students.

As a first step, we’ll be examining the ways in which languages are unique and the ways in which they are similar. For this, we’d really like to use the knowledge of everyone involved in the Exercism community (students, mentors, maintainers) to answer the following questions:

  1. How was your experience learning Groovy? What was helpful while learning Groovy? What did you struggle with? How did you tackle problems?
  2. In what ways did Groovy differ from other languages you knew at the time? What was hard to learn? What did you have to unlearn? What syntax did you have to remap? What concepts carried over nicely?

Could you spare 5 minutes to help us by answering these questions? It would greatly help us improve the experience students have learning Groovy :)

Note: this issue is not meant as a discussion, just as a place for people to post their own, personal experiences.

Want to keep your thoughts private but still help? Feel free to email me at erik@exercism.io

Thank you!

Prior to learning Groovy, I mainly coded in Java. I learned a bit of Ruby and Python, too.

The reason I looked at Groovy was the discussion about using List.of(1, 2, 3) of Guava library vs. native Java new ArrayList<Integer>(1, 2, 3). To me, those things were unnecessary implementation details, especially in tests. So I went on looking for a language that would have even simpler constructs. And Groovy, with it's [1, 2, 3] literals seemed like a perfect match.

It was very easy to switch to Groovy since bach then it was ~95% Java-compatible. Since Groovy 3, it's even 100% compatible, I believe. This was also a big plus in convincing my teammates to give it a try. The Spock framework was another driver for using Groovy to test Java code - the readability of our tests just sky-rocketed.

Probably since I already knew Java, I didn't have any problems while learning Groovy (compared to learning other languages like Python, Ruby, Go, or Haskel). With Groovy, I could always fall back to solving problems in "Java-way" and make it "Groovier" once I've learned about certain Groovy features.

While learning the language, I was immediately amazed how I can express the same things as in Java with way less boilerplate or unnecessary details. I was able to focus more on the "what" my code is doing, not the "how".

I had a few iterations of "aha" moments with Groovy when I was able to express myself in the same piece of code even better than before in code by applying other new features I've learned so far.

The only few weird things that come to mind are some unconventional method names (collect vs map, inject vs fold or reduce, ...).

I still find Groovy one of the most expressive languages I have learned so far. And also, currently, Groovy would be my "go-to" scripting language for non-trivial tasks (I'd use bash for the trivial ones).

We're closing this issue as it was part of our research for the v3 version of Exercism which has just been released.

Thanks everyone for chipping in! It has been greatly appreciated.