Re:The Play Framework at LinkedIn
by happy_dino on Friday February 22, 2013 @06:16PM
(#5267565)
It's funny that you keep picking blatantly wrong examples.
scala> def ==(a: Any) = false
<console>:7: error: overriding method == in class Any of type (x$1: Any)Boolean;
method == cannot override final member
def ==(a: Any) = false
^
Maybe you should actually use the language for a few minutes before commenting? :-)Maybe you shouldn't try so hard to deliberately misunderstand what I'm saying. Your nitpicking doesn't change the fact that you can redefine what == does in your own classes.
I hope you do realise that my point isn't even specifically about Scala, but about syntactical abstraction in general.
And I don't agree that it's a theoretical problem that only arises with bad code. It's simply a downside that we have to be aware of when we use DSLs, even well designed ones. For some purposes bland code is just better than smart code.
But I do agree that a Scala based DSL is hugely superior compared to any byte code manipulation based Java framework that obscures lanaguage semantics beyond recognition. It's also way easier to reason about Scala code than about Python/Ruby style meta programming.