The Sincerest Form of Flattery
summary
Java adds generics (2004), lambdas (2014) and pattern matching (JDK 16+) but keeps type erasure, so generic type info disappears at runtime and arrays of generic types are illegal, causing surprising runtime limits. Java implements lambdas via single-abstract-method interfaces and forbids capturing non-final locals for thread-safety, while Scala implements declaration-site variance, native first-class functions, and partial application with real closures that can capture mutable locals (trading safety for expressiveness).
AI-written summary · about
chapters (14)
- 0:00Introduction
- 0:40Presentation
- 2:43Functional Programming
- 6:22Generics
- 8:48Type erasure
- 17:28Scala
- 21:03Closures
- 22:46Function Syntax
- 24:14lambdas in Java
- 26:05functions in Scala
- 27:05partial application
- 28:10Scala partial application
- 31:41Instance of string
- 32:58Record class
related talks
51mThe Sincerest Form of Flattery
58mJava Sucks (So C# Didn't Have To)
16mThe past, present and future of the Java type system
53mFun with var in Java 11
56mJava Sucks (So C# Didn't Have To)
44mIt’s Java, but Not As We Know It
39mImplementing Lambda Expressions in Java
53mLambdas in Java: A Peek Under the Hood
