Ted Newards’ talk about functional programming in Java and his workshop on Scala (hence the article title) were the most memorable events during the third
JDD conference that I attended last week. Sadly most memorable, and almost the only ones. But first things first.
After spending endless hours with great
Enterprise JavaBeans 3.0 book by
Bill Burke I’ve expected something fabulous, but Bills’ lecture about JAX-RS was just average, with no coding, only plain API introduction. Scott Davis' presenting REST and ROA
last year was way much better. Thankfully
Angelika Langer talk about Java concurrency pitfalls was much more interesting, although one might argue that she just gave a summary of marvelous
Java Concurrency in Practice book, that I have
recommended long time ago. One new thing I’ve learnt is that updating volatile variable guarantees all other non-volatile variable updated earlier by the same thread to be visible by other threads, as if they were volatile as well (are you following?) After Angelika there was a talk about Java performance testing, but I had a copy of
The Art of Application Performance Testing book in my knapsack, so the presentation didn’t caught a lot of my attention.
After delicious lunch Ted Neward gave a talk on functional programming concepts in Java. Charismatic, entertaining, surprising – I knew he will make a great show. In the middle of third or fourth slide he asked innocently who prefers slides to live coding and after finding no such person on the audience, he instantly closed the presentation and opened notepad, writing some Java code from scratch. It looked so natural that I almost believed that he actually had any slides further – but of course this was all set up. Ted mentioned
Functional Java library as a way to enable functional style of programming in plain old Java. Another libraries I can point out if you have to stick with this language are:
Fun4J, Google's
Guava and
LambdaJ. Also take a look at
Lombok to write more concise POJOs.
I’ve seen
Piotr Walczyszyn several times evangelizing Flex and AIR so it came a bit of a surprise that I really enjoyed his talk, even though I don’t like front-end programming. But a real surprise was the
Linda Rising presentation dealing with the problem of introducing change and convincing our coworkers to it. From time to time we need to look at our job from 10,000 ft perspective, see how ridiculously we sometimes behave and how irrational our choices are.
See Pragmatic Thinking and Learning... for a more in-depth analysis on this. Also I recently read marvelous
Dreaming in Code by Scott Rosenberg. Linda’s talk complemented these books excellently.
On the next day I sacrificed three presentations to participate in Ted Neward’s workshop on Scala – continuing the subject of functional programming. He introduced Scala language step by step, emphasizing the differences and commons misconceptions. I will repeat after him: Scala is compiled, statically typed,
consistent language, don’t compare it with Groovy, these are completely different tools. I was doing my best to follow Ted’s examples on my computer and finally I wrote few simple (compiling!) lines of Scala code. Too bad my first presentation on Scala (
during GeeCON 2009) by Luc Duponcheel wasn’t that good and simply beyond my comprehension. Here are few examples of Scala concepts that significantly caught my attention. POJO in Scala:
import org.apache.commons.lang.builder._
class Book(author: String, title: String, year: Int) {
override def toString =
new ToStringBuilder()
.append("author", author)
.append("title", title)
.append("year", year)
.toString()
}