5 ms·
Mutability and inheritance are good solutions to certain classes of problems, and it's valuable to have them in your toolbelt. What's scala designed for? Progr
by lmm 13y ago
Mutability and inheritance are good solutions to certain classes of problems, and it's valuable to have them in your toolbelt.
What's scala designed for? Programming - not just highly concurrent programming, not just quick scripts to do some text manipulation, not just web services for millions of requests, but all these things and more. It's the most generally applicable language I've ever seen, and there's real value in being able to write your whole platform in a single language which is nevertheless a good fit for a very wide range of problems.
I don't think it's fair to say each feature is piled on to plug a specific hole; rather, a lot of the power of scala comes from the interaction of several features that are individually quite simple. E.g. unlike Haskell's typeclasses which have to be built into the language, in scala that's simply a pattern that you write in regular code. Unlike Erlang's built-in notion of actors, in scala Akka is "just" a library.
- pron 13y ago> Unlike Erlang's built-in notion of actors, in scala Akka is "just" a library. So what? In Erlang it's part of the language because Joe Armstrong et al. thought that this is how modern software should be written. They figured they'd need immutability, process isolation, and message passing. In Scala you can do that in a library minus (guaranteed) immutability and isolation, which were the whole point to begin with. Same for Haskell. They've figured that an unbreakable type-system with functional purity will make it easier to write bug free code. So Scala takes the rich type system (that has its own mental cost), but removes the purity and the safety which are the the whole purpose of the exercise (or much of it, at least). I could go on and on (with macros, implicits and more), but Scala never fails to miss the mark. It adopts a feature without adopting the philosophy that makes the feature powerful. > Mutability and inheritance are good solutions to certain classes of problems, and it's valuable to have them in your toolbelt. Sure, but not if I have to pay the price of such a complex type system, that was designed for languages without mutability and inheritance! Each of these features is good in isolation, but combine them, and you get a mess. Scala is a the pizza-ice-cream-soup-steak-salad. Each has its place, but not as part of the same fucking dish! What is wrong with using one coherent language for one problem, and another for a different one? That's what Scala's designers don't seem to get. They simply have no taste. They're gluttons. I certainly wouldn't mind the generality if only the mental price I had to pay for it wasn't so high. A lack of guidance is not bad in and of itself - C offers no guidance and no guarantees, and is fit for many tasks - but combined with so many haphazard features and mind-boggling complexity, it becomes a liability rather than an asset. You end up paying the price for each of the features, but reaping few of the rewards. I think programmers are the last people this language is for. In fact, I think Scala is mostly made to amuse its compiler writers.
- pnathan 13y ago> What is wrong with using one coherent language for one problem, and another for a different one? Some shops really hate doing work in multiple languages. If designing a language for general industrial use, I'd think long and hard before writing a language that was not at least somewhat sort of decent at everything.
- jfb 13y agoScala reminds me of nothing so much as C++. Yeah, you may not want to use what is to you some obscure corner-case feature, but it's 100% certain that you will encounter some code written by someone with a different view of what is and isn't critical. So you need to keep this enormous pile of abstractions and their interactions in your working set, or you're off to the documentation. I don't entirely see the value in having these "big-tent" languages, where everyone writes their own dialect but imposes that mental cost on all of the other readers. Odersky is clearly a very smart guy, but I'm not persuaded around his way of thinking. Scala is more expressive than Java-the-language (it'd be difficult to be less so), but that's not the only metric one should use [1]. [1] PLEASE DO NOT READ THIS AS AN ENDORSEMENT OF JAVA-THE-LANGUAGE.
- dragonwriter 13y agoThe value for big-tent languages like C++ and Scala comes pretty much from the following factors: 1) There is an existing language that has become widely used in a domain (or a variety of domains) with a well-developed ecosystem, and 2) There are well-known limitations of that existing language for the domains in which it has become widely used, and 3) The existing alternative languages that take conceptually pure approaches to addressing the problems with the existing dominant language have problems making use of the ecosystem that has evolved around that dominant language and/or pose a difficult transition for programmers versed in the dominant language, and 4) The "big-tent" language provides an easier transition for people versed in the language than purer alternatives (by way of more directly supporting the idioms of the dominant language) and has better support for leveraging the existing ecosystem that has grown up around the dominant language.
- lgieron 13y agoThe scala scripting is an oft-overlooked feature, and I think it's pretty great. You can compile your codebase into a jar, upload it to a server and link to it from a script in Scala you're editing there in a console text editor. Advantages: - no compilation required, while still maintaing static typing checks - since the script is the same Scala language as your main codebase, you can copy/paste code snippets into script for increased productivity From my experience, it's been great for one-off data processing jobs done on the server.
- eeperson 13y agoIn Scala 2.11 you will be able to use Scala as a standard Java scripting engine: http://docs.scala-lang.org/scala/2.11/ http://docs.scala-lang.org/scala/2.11/