3 ms·
What exactly is inherit about duck typing or OO that say they can only be used in a simple language? Duck typing works great in Scala, more so then in Javascri
by efuquen 13y ago
What exactly is inherit about duck typing or OO that say they can only be used in a simple language? Duck typing works great in Scala, more so then in Javascript because it's type safe and it's impossible to make the same mistakes you can easily do in Javascript. Scala's OO is vastly more powerful then Java's and IMO opinion more elegant and simple to use. I look at these features in isolation what I see are much better designed implementations of those ideas, I don't see how they can only make sense in a language that's simpler then Scala.
This notion of simple also confuses me. You mention Javascript, and while I agree Javascript is easy to write I would certainly not call it a simple language. There are a huge number of inconsistencies, gotchas, and just plain head scratches littered throughout. And let's not even get started on the hot mess that is prototypical inheritance in. Java is hardly simple, it's outdated and probably one of the main reasons there is a movement to other languages are because of the lack of new paradigms integrated into it's core, but that certainly doesn't make it simple. I can show you some pretty nasty Java code bases that can be just as if not more confusing then some of the worst Scala code I've seen out there.
In terms of focus, I think Martin and the community has been pretty clear about what Scala is about, an OO based functional language that focuses on practicality over theoretical purity. If it was meant to be an academic language why focus on Java interoperability so much? One of the beauties with Scala (though some might disagree) is you can basically write it to look just like Java, which is why it can have a leg up over a language like Clojure, whose syntax is so different. Why include mutable state at all? That certainly isn't a trend with academic languages, but it certainly is practical to allow when performance reasons dictate it. Why create Typesafe and have all this focus on strong native build tools and good IDE integration? I honestly don't think Martin just decided one day out of the blue that he wanted to make Scala a practical language, that's been part of the game plan from day one. The precursor to Scala, Funnel, was dropped specifically because he didn't feel it was a practical language and he started over and wrote Scala.
I think Scala has been finely tuned for it's purpose, to provide an elegant synthesis of functional and OO paradigms that allow developers not use to those ideas to slowly wade into that new world. That's the way I was introduced to it and that's the way I know many other developers have been introduced to it, with good results. Having worked at a few different companies of varying size, all with large code bases in Scala, all training new people with the language, I can say it's definitely possible to get large teams working on complex problems to adopt it and thrive. And I'm starting to see more and more adoption, both in the enterprise and at startups as well. I think plenty of people are jiving well with their new chosen instrument, it's fine if you don't like to play it, but I don't think it deserves to get knocked off as an unplayable mess as a result.