Posts Tagged: Groovy programming language

computer code

Polyglot or poly-framework?

Posted by & filed under , .

Our Universe is expanding every day — and I mean this in the sense of our “programming universe” (though the other, ad literam interpretation is true as well, since our actual physical Universe is expanding indeed). Every meetup and every website I come across advocates a new framework, a new architecture, a new language, a […]

Of Fibonacci’s Number and Groovy’s Memoization

Posted by & filed under , .

As a developer, chances are every time you hear recursion mentioned you probably also hear of Fibonacci’s number. And in the same breath you probably hear also of stack overflow 🙂 Because — as you get to learn quickly — if you decide to implement Fibonacci’s number via a recursive function, you end up abusing […]

Collection Sorting — Java vs Groovy

Posted by & filed under , .

With the introduction of lambdas in Java (not so) recently, some argue that Groovy lost some of its thunder, as closures are now first class citizens in the JDK. However, as I’m about to show, while lambda’s pushed the Java language a great deal forward, Groovy still makes a lot of things incredibly easy (and […]

A Bit of Lovin’ for the Groovy Object Initialization

Posted by & filed under , .

I’m going to spread some lovin’ today for the widely-used yet less appreciated feature in Groovy which allows creating a Java bean and setting its properties in one line. Especially when dealing with unit tests this saves me a great deal of time and frustration. If you ever worked with “pure” (??) Java beans, then […]

Goodies in Groovy from DefaultGroovyMethods

Posted by & filed under , .

If you ever programmed in Groovy language, you probably “enjoyed” (maybe without realising) the joys of DefaultGroovyMethods. What you probably don’t realise is that you can override these methods to customize your classes — and occasionally generate some code that’s not that easy to read. (Do you remember the old C++ way of overriding operators […]