Sunday, March 23, 2014

Multi-value maps improved a lot

Last week I sat down and decided I should pick a rather sizable project and work on it for the practice value. Midway through Java 8 was released, so I integrated that into my project. I'll get back to that in a future post.

I must say it's pretty difficult to expose yourself to all the new and cool stuff that's around when you're working as a programmer. Code bases tend to get stuck with the tech that was around when the first shovel hit the ground.

I think my biggest "huh, that's cool" about Java 8 today is how much it simplifies multi-value map semantics. In pre-8, they were pretty seriously clunky to work with.

Saturday, March 22, 2014

Conflicted about new programming language releases

I've been meaning to blog more, and post more code, so here's killing two birds with one stone :-)

I'm always deeply conflicted whenever there's a new version of a programming language I like around. On the one hand, I get to play with new and interesting features, but on the other hand, aimlessly using new features tends to lead to pretty messy code that uses them for the sake of them existing, rather than them adding something to the code.

I think a lesson I learned with C++11 is that less is definitely more with closures, but for those rare instances they are legitimately called for, they can really improve the code. It's sort of about letting applications find you, rather than going out actively looking for ways to cram lambdas into your code.

Today it happened in Java though. I legitimately produced cleaner code by using a Java 8 lambda function that I possibly could otherwise. Great success! Here is the outcome (function delegation is at line 52, in processDocument()).