back

by dochtman·15y ago·view on hn ↗
I did some research (but not actual programming) to compare Java to Scala, specifically in the area of generics. If you are hoping for some language to make static typing palatable again, Scala is not it: it's so good at static typing that it can statically type anything, but it takes intricate details and more knowledge of its type system than most would want to care about to get it right. In general, I felt there were too many niggly little details in the syntax to be a nice language to use.

Of course, I'm used to Python, so I may well be spoiled.

2 comments
I agree with the characterization of Scala's generics as complicated, but I disagree that that ends up making its static typing unpleasant or day-to-day programming difficult. Type inference is a big win, and other language features add enough that I find myself not reaching for generics for my own code anywhere near as often as I did with Java. Aside from the occasional container type missing from the standard API, I just pretty much don't use generics in Scala except as a consumer, and I don't miss them.
I actually do programming in Scala and I'd have to disagree. While there's the freedom to build a "type castle", you don't have to. For the most part Scala gets things right.

When you do need/want to get fancy with types, you get some of the best tools out there to do it.