The hand that rocks the Gradle

Jon

June 26, 2020

An old lecturer of mine was of the opinion that your favourite programming language is always the first one you learn. While it’s a bit of a generalisation he made a solid argument nonetheless. You’ve learned it, and with it you can perform tasks that you otherwise would not be able to do. The second language rarely has the same appeal. There’s almost always a lot of overlap, you feel like it’s all stuff you already know, and the syntax is similar but just different enough to where you frequently make mistakes. It’s more conflicting than convenient.

What about build tools?

With build tools this isn’t the case. The first build tool I was exposed to was Gradle. My lecturer didn’t have a rule for build tools but I like to think it is comparable to alcohol. It’s less about which came first and more about which you associate memories so traumatic and vivid that just the thought alone is enough to warrant a biological response. For me that alcohol is vodka, and my vodka is Gradle. I dislike Gradle! I dislike it so much! I do not understand how it never seems to be the right version; How hardware intensive it can be; How vague it’s errors can be; How it’s the default build tool for Android Studio; I do not even like the logo, something that encourages so much vitriol should not have such a cute logo. But most of my distaste for Gradle is due to my first encounter with Gradle being a complete disaster.

Story time

I was an intern tasked by the local council to develop a mobile app that would promote healthy living and local attractions, we had some good ideas and our client seemed really excited to see what we would produce. (This was 2016 and people were actively encouraged to go outside.) There was a small team of us that had been granted access to a room in our university with which to work out of. We decided upon using Android Studio because it was readily available and as students “free” was really the only criteria we had. We were optimistic. Little did we know Gradle would be there to torture us at every possible opportunity.

Every day Gradle would need to update and that would require admin privileges that we didn’t have, only then once we had managed to get them would it proceed to consume the entirety of the machines somewhat limited processing power. (I do not know where the tuition fees were going). So finally the updates have finished and Gradle now proceeds to inform us that the version was now incompatible with something else and needed to be changed once more. This quickly became the daily routine. Not long after we had changed our entire development process to cater to the Gradle gods as not to incur their wrath.  

Cut back to 2020, the latest health app tracks your exposure to the outside world and encourages you to stay indoors. I’m tasked with working on a project that uses Gradle once again and once again it’s not working. Some version inconsistency between Gradle and Java has me scouring the internet once more for the wisdom of the Gradle gurus that lurk there and I can’t help but wonder how these people came into existence.


Is it true?

The best way I could describe becoming a Gradle guru, as someone who hates Gradle, is mithridatism - “the process of acquiring tolerance to a poison by taking gradually increased doses of it” Not unlike being bitten by a venomous snake, I don’t think I will ever enjoy working with Gradle but maybe with time and several more traumatic nightmare experiences I will develop a tolerance to it’s poison. Maybe my old lecturer's theory does apply to build tools as well and your favourite build tool is in fact the first one you learn. I just didn’t put in the time required to learn the intricacies of Gradle? Perhaps if I took the time to fully understand all the tools I use instead of just practising trial and error with the help of stack overflow I would be able to pre-empt these issues and avoid them entirely? Could it be that Gradle was never really the issue but my gung-ho nature, lack of patience and need for a quick fix, were the true causes of all my suffering?

Jon

Jon

Software Engineer working as part of the nerd.vision team