Steve Jenson's blog

I had an argument with myself in the shower about whether inner classes should really be described as "basically lambda" to beginning programmers.

Lambda is nested function definition (some argue no side effects, others argue side effects are ok), and inner classes are nested object definition. What's the difference, you ask?

Functions are code and Objects are not code, they are data structures designed to easily organize functions, fields, and other objects. Inner classes can't convey any of the power that nested functions are capable of, besides nested scoping.

Java is not a functional language, no matter how much it borrowed from Lisp, so I think we should stop confusing kids by telling them that inner classes are lambda and just make them learn scheme for a few weeks.

# — 03 January, 2002