Wednesday, 15 May 2013

Launching Into Lambdas

Over the last few months I have had loads of fun learning about "Closures" or "Lambdas" in Java 8. For anyone else interested, here is a collection of resources that maybe handy! :)

Java One 2012 - Jump Starting Lambda

This is a really in-depth presentation that goes a lot into the motivation behind Lambdas. It contains pretty much all the information you need to get started but I'd perhaps go for a shorter/simpler presentation if you want to get started quicker. Maurice's talk below is great for this! xD

DevOxx UK 2013 - Collections After Eight by Maurice Naftalin

I was actually lucky enough to attend this talk and it was my first real exposure to Lambdas. The actual talk should hopefully be up on Parleys soon but the slides are available. Really recommend this as Maurice explains things beautifully.

Steams API Cheatsheet
I'm going to have to put together one for this! For now, Maurice's talk above has a lovely slide "Some Steam Methods" (just after the middle) which contains a brilliant table explaining the stream methods and the lambdas they take.

For now my best tip is to download IntelliJ IDEA 12 which has absolutely brilliant lambda support. ALT+ENTER is your friend! A great way to learn lambdas is to understand how those anonymous inner classes you right can be "lambda-rised" by IntelliJ!

GitHub - Lambda tutorial by Graham Allan

Graham has spent some time to put together an awesome tutorial for Lambdas, available on GitHub! Martijn has contributed to this and given it the thumbs up so it must be awesome, right?! :P

GitHub - Playing Parallel Stream + Simple Benchmarking

Here is one of my late night, post Code Dojo hacks I threw together. I experimented a little with Parallel Streams (hurray for simpler concurrency), doing a very simple and most likely flawed benchmark on the performance of different sorting algorithms.

GitHub - Using Collections Streams

Another Code Dojo inspired hack, except this time it actually makes sense and it really highlights a real use case for Collection Streams. I didn't complete the code for everything we did in the Kata but I think it covers the core of it well.

No comments:

Post a Comment