Two small points of feedback

Stephen Colebourne scolebourne at
Fri Jan 4 06:42:18 PST 2013

In our regular lunchtime meeting at OpenGamma I posed two questions to
get feedback:

1) "What does this code do"

  range(1, 10).forEach( (i) -> System.out.println(i) );

First response "if that doesn't print 1 to 10 then someone needs their
head examining" (someone working in multiple languages more focussed
on maths than Java coding)
Second responses "suppose it might depend"/"have to check docs" (Java

Personally, I think that while it can be explained/documented that it
is a half-open range, it reads far better in code as a closed range.

2) "Which of these corresponds to IntFunction"

  (int) -> T
  (T) -> int

Response chose the first (whereas the codebase has the second).

Personally I would choose the first (and use FuncInt, FunctionInt,
CalcInt, CalculatorInt or IntCalculator for the second).

(poll highly unscientific, respondents had limited/no exposure to
lambdas, yada yada yada)

More information about the lambda-dev mailing list