Sunday 4 January 2015

The Inexistent Resolutions

I have never made resolutions. Ever.

I have never made a list of things I plan to do by the next 31st of December. I certainly have a list of things I have not done since the last 31st of December and sad to say, this list grows by the year, its tail gets lost along the way while the tasks in it become irrelevant with time.

But, hey, there is also a smaller (albeit no less important) list of things I have done. So, I will focus on this list – it’s shorter and easier to write about Smile.

Visiting Java

I write “visiting Java” as if it were a place (and it is, in Indonesia) but obviously I am talking about the Java eco-system and – more recently discovered – the community that stands behind it. Yes, I’ve revived my Java blood-stream over the past year, to my great pleasure.

Event #1 : Meet-A-Mentor

Well, this is not really a Java event, but it is organized by the special folks at RecWorks, one of the most interesting recruiting companies on the banks of the Thames, folks who also organize London Java Community. Clear, right?

I’ve taken part to one of the sessions and I am anticipating one in January. Great, uplifting event. Always refreshing to have contact with young, bright minds and a pleasure to liaise a little bit with fellow mentors.

One interesting detail: it seems there is a lot of emphasis on data science out there in the campus land, I think half of the students I’ve talked to were expecting jobs as data scientists. This was quite surprising to me. The interest was so keen that one student asked us “which tool is better for X type of data analysis, Y or Z?”. How would you answer that?

Event #2 : Open Java Conference

The past November, OJC in London at the IBM Centre, close to London Eye and the world famous Tower Bridge. Awesome event - not free, but with a very affordable fee. A wide variety of presentations, from the easy and light (“how to fix Enterprise Software?”1)) to the more hard-core (IBM Watson architecture, optimizing Java by sniffing into the workings of the Hotspot compiler, etc).

Food included in price and mediocre, as it is expected at such a great geeky event. A little bit too much socialising for my taste, the long breaks (for obligatory networking) could have allowed for at least one more round of sessions. But people nice and friendly, knowledgeable of what they were talking about and the event very well organized and definitely something not to miss. Ironically, in 2013 I had purchased tickets for this conference but I didn’t go. I won’t repeat this mistake.

Not to forget, during OJC London 2014 it was quite an emphasis on the Adopt OpenJDK initiative which originated in London (or LJC is an active part of it). This leads to the 3rd event …

Event #3 : OpenJDK Hack Day

Organized by LJC and hosted by the Salesforce office in London (in the Salesforce Tower – or Heron Tower – in the heart of the City; the view from high over London was coming as a bonus), it was a day of hacking into the source code of JDK 9 (due in 2016). Well, not really hacking (at least not for me) but a day of familiarising oneself with the source code of JDK (how cool is that?).

Food and desks provided, a “bring your laptop” event attended by 30 or so developers. A smaller Clojure seminar on the same premises, the same day. Spent whole day setting up a development and build environment for JDK using the latest and greatest sources of OpenJDK which, believe it or not, it is the reference implementation of the upcoming JDK that will be GAed by Oracle for worldwide consumption.

People at LJC friendly, approachable and helpful – as usual. Like for other open source projects, the documentation is less than perfect so getting help is essential. Started from a pre-cooked Ubuntu Virtual Machine and obtained in several hours a JDK 9, freshly baked. Yummy!

Back home I came and on my beloved desktop I put the effort to construct a fully fledged development environment on the latest Ubuntu, using the latest tools and binaries as published by Canonical (and Oracle, and others) on my very own VM built from scratch in Oracle VirtualBox. After a couple of hours, lo and behold, I had my own JDK 9 again which I could compile clean in less than 20 mins (on a dual-core 8 GB VM hosted by a 16 GB machine).

The great part in all of this is that anyone who knows Java can contribute to the development of future Java. There is a little bit of formality involved, you need to sign an agreement which essentially says that you abide to the open-source principles and, obviously, your contributions will be strictly triaged until you become familiar enough with the code that you obtain commit rights. I haven’t started really working on this but plan to do it soon, on regular basis. The beginning is to ensure that various projects compile well on JDK 9, including my project. This leads to …

The Secret

I started my own project. I won’t disclose what is about, I hope to open source its first version soon (in 6 month – 1 year). But it’s Java 8, it makes use of latest goodies like streams, extensible interfaces, lambda expressions and niceties like Optional<T> and the like. It is quite theoretical for the moment but it will eventually touch things like Java Enterprise, NoSQL and Big Data.

I can finally say that Java is a pleasant language to write in! Thanks to streams one can compose operations very much like in LINQ-over-objects, lambda expressions dispense of most local variables (a great source of bugs), collection operations over streams permit elimination of the annoying for loops, Optional<T> with its wonderful map() and orElse() eliminate if-else in many cases and extensible interfaces allow specifying the fundamentals of an algorithm directly in the class contract, much like in traits. Who needs Scala?

This changing impact is so important that in my project I don’t think I have 5 (five) for loops in over 5000 lines of code which uses collections heavily. The if-else statements are more numerous (because sometimes it is less natural to formalize conditioned execution as computation over Optional<T>) but still greatly reduced in number.

Java 8 really has a different face from Java 7, a functional one, and if some one wishes to use the old, clunky, cumbersome and error-prone style of procedural and imperative programming, he can still do it (there will always be room for bad code, unfortunately).

Conclusion

Not many achievements during past year, I admit. No resolution for the new year, either. But one word is shining through: Java. For the year to come and beyond.

Regarding contributing to OpenJDK, if one wants to take this rewarding path, the best way to start is to search for OpenJDK, Java.NET or Adopt OpenJDK programme. The OpenJDK effort is kept alive in London by the great guys at London Java Community whom I am very happy to join.


1) My answer to this ardent question is "don't fix it, replace it immediately".

No comments:

Post a Comment