lambdaj proves Java programs can be concise and even more elegant – in a functional kind of way
Is the Java programming language too verbose? lambdaj clearly proves the answer is NO.
Java programs usually are, because Java APIs (starting with the SDK) have built a poor reputation for the language.
This powerful library might help us change that in the future.

In a nutshell, lambdaj allows you to manipulate collections in a pseudo-functional and statically typed way.
This means you can reduce your stereotypical and superfluous ways of looping in Java to equivalent one-liners that are:
- much easier to understand (thus allowing you to focus on the actual problem not on details)
- type safe, being written in Java benefits from static typing (and all the good things that derive from here – clear semantics, compiler checks, tool support in refactoring)
- concise, less error prone, giving you more power per line of code
Below I pasted some usage examples from their site.
I did not add any explanations, because I’m sure you’ll understand what’s going on straight away:
List<Person> personsInFamily = asList(new Person("Domenico"),
new Person("Mario"), new Person("Irma"));
forEach(personsInFamily).setLastName("Fusco");
List<Person> sortedByAgePersons = sort(personsInFamily, on(Person.class).getAge());
List<Integer> biggerThan3 = filter(greaterThan(3), asList(1, 2, 3, 4, 5));
List<Integer> ages = extract(personsInFamily, on(Person.class).getAge());
Map<String, Person> personsByName = index(personsInFamily,
on(Person.class).getFirstName());
Person me = new Person("Mario", "Fusco", 35);
Person luca = new Person("Luca", "Marrocco", 29);
Person biagio = new Person("Biagio", "Beatrice", 39);
Person celestino = new Person("Celestino", "Bellone", 29);
List<Person> meAndMyFriends = asList(me, luca, biagio, celestino);
Group<Person> group = group(meAndMyFriends, by(on(Person.class).getAge()));
List<Person> oldFriends = filter(having(on(Person.class).getAge(), greaterThan(30)),
meAndMyFriends);
I really look forward to use this powerful tool!
Forget OO… use a Rule Engine !
This is the most funny-scary reason to build/use a rule engine for your apps:
“Drools / JBoss Rules is a very good solution to stop your business logic from being fragmented and scattered throughout your code” from Paul Browne (http://www.theserverside.com/news/thread.tss?thread_id=43901#225703)…
or in other words and images:
Why use a bus (a highly cohesive business object encapsulating several rules and behaviours), when you can use several cars (rule objects) to achieve the same thing ?

Rules vs OO
Which option is greener ? (image from http://makeitgreen.webs.com/cbb.html)
Software Development Evolution
It is becoming more and more clear to me that the next significant step in software development evolution will not be a new technology or a new tool,
but an approach that successfully incorporates our hardwired human nature in the way we develop.
In InfoQ Interview: Linda Rising on Collaboration, Bonobos and The Brain Linda Rising points out that scientists initially believed the conscious mind
is like the tip of an iceberg, while the subconscious is the remaining 90%. However, later studies suggest that our subconscious is the whole iceberg,
while our conscious is actually just… a snowball on top of it.

If only we could learn how to drive this iceberg…
Being Agile as a personal skill
I have stumbled yesterday on this presentation given by Linda Rising at QCon SF 2007: “Perfection Is An Unrealistic Goal”.
It underlines the impedance between how humans are hardwired to work (in ~90 min focused sprints followed by a 20-30 min break)
and the prejudices haunting our workplaces (where productivity is associated with longer hours without any break and agility means
people can interrupt each other at any time).
Mark Twain brings you the news
Today’s news on guardian.co.uk:
Bank shares finished dramatically lower, with RBS – almost 70% owned by the taxpayer after yesterday’s announcement – down by 65%
and Lloyds HBOS suffering a 33% loss. Barclays, which lost a quarter of its value on Friday, fell a further 10%.
One century-old lessons still unlearned:
A banker is a fellow who lends you his umbrella when the sun is shining, but wants it back the minute it begins to rain. (Mark Twain)
Can we make it to the other side ?


The Broken Bridge and The Dream – Salvador Dali
Take that, religious fanatics…
Precise measurements reloaded: God is to yardstick as Faith is to …

religion?
Quote of the day
“Only those who dare to fail greatly can ever achieve greatly.” – Robert Kennedy
Quote of the day
“Men go abroad to wonder at the heights of mountains, at the huge waves of the sea, at the long courses of the rivers, at the vast compass of the ocean, at the circular motions of the stars…
and they pass by themselves without wondering.” – Saint Augustine
