Hacker News new | ask | show | jobs
by kingkilr 5406 days ago
That first claim, that it's as expressive as Ruby, just doesn't hold up to scrutiny. (I've never used Ruby much, but I know my Python, and I'm going to assume they're approximately equally expressive). In no sane Python codebase would you see copy-paste that looks like:

https://github.com/foursquare/rogue/blob/master/src/main/sca...

or

the function/tuple/product classes found here: https://github.com/scala/scala/tree/master/src/library/scala

2 comments

Being able to tell the computer basic things about your program definitely makes the language MORE expressive, not less.

I don't disagree that letting people express themselves isn't always very useful...

Well, all these tuples can be represented as a List[Any] object in Scala with no problems and it would be just like any other dynamically typed language. However, if you want static type checking of your code, then yes - it is useful to tell the compiler the constraint on the range of values that are valid for your object. This is generally not possible in dynamic languages and should not be surprising.