Monthly Archives: October 2016

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 […]

Gradle Multi-module Projects — Centralized Configuration

Posted by & filed under , .

This is a sweet gradle trick for those of you working on multi-module projects, if you are looking to centralize some of the configuration in the parent gradle build, and avoid repeating configuration / build code across sub-modules. Let’s say you have the following gradle project structure (see image below) where project A is the […]

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 […]

Parallel : Groovy and Java Streams

Posted by & filed under .

This is something that every now and then I have to do: check whether either one or all elements of a collection meet a certain criteria. The standard code initially in Java involved a for loop and iterating through the collection explicitly and checking the condition at each step. Then Apache Commons came on with their […]

The Big Data Scare

Posted by & filed under , , , .

I came across this article on Tech Crunch today (AI accountability needs action now, say UK MPs) and wanted to share some thoughts on it. It sounds to me like once again Europe, and UK in this case, is getting cold feet about AI and big data and the interesting results this renders sometimes. Because […]

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 […]

On Java Annotations and Type Safety

Posted by & filed under , .

Nicolas Fränkel published a blog entry recently talking about “Type-safe annotations” in Java — which trigger my thoughts on the same matter, and voila, there’s this post as a result of it. This is in fact my 2 cents on the matter — and as such I’d recommend you read Nicolas’ point of view too […]