r/programming • • Jun 11 '16

My Increasing Frustration With Clojure

http://ashtonkemerling.com/blog/2016/06/11/my-increasing-frustration-with-clojure/
176 Upvotes

225 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Jun 16 '16

Delegates, events, more sensible covariance/contravariance, structs, generics that can handle List<int>, etc...

1

u/frugalmail Jun 16 '16

Thanks. I'm curious to hear more.

here is my current understanding:

Delegates, events

This is a non-issue post-2014 as Java8 supports Lambdas

more sensible covariance/contravariance

I've encountered this problem myself with C# that I have not encountered with Java. Assuming this is still a problem, are there other things? http://stackoverflow.com/questions/9806170/covariance-and-contravariance-in-c-sharp

structs, List<int>

There are two reasons for structs, one is for compute performance, and the other is for memory performance. java still outperforms C# using Hotspot/JIT, so that's not an issue. For memory performance you do have to use workarounds like librariers of concrete collections or heap based memory manager librariers. Odds are Java 9 or 10 will have structs though, so it is an acknowledged limitation.

The concrete collections (PCJ, Trove, Colt, tclib) are also a workaround to List<int>s, and structs should also resolve that disparity.