|
|
|
|
|
by eropple
2686 days ago
|
|
C# lets you do that because C# doesn't have a way to declare a local readonly/final variable at all. I significantly prefer features that encourage the use of `final` variables everywhere that it is possible in Java. I write C#, Java, and Kotlin in roughly equal measure. Each has its pluses. But the claim that Java's lambdas are worse because it doesn't let you--and this was a conscious design choice!--do something so potentially catastrophic and difficult to debug is an odd one. |
|
And yet it didn't - which made implementation that much more complex, since capturing mutable locals requires lifting them to extend lifetime.