3 ms·
Having worked with both Scala and C++, I actually think that people saying this don't know what they are talking about. I encourage you to take another look, a
by bad_user 13y ago
Having worked with both Scala and C++, I actually think that people saying this don't know what they are talking about.
I encourage you to take another look, as we often jump to criticisms with only a superficial understanding, often based on comments made on forums by other people. In particular, the idea of writing the code in a certain way to avoid recompilation is rather silly and I never, ever did it in the last 2 years since I worked with Scala.
On syntax and complex language features - having trained rookies unfamiliar with Scala myself, I can tell you - it's neither the syntax or the language features that are problematic, but rather the concepts involved. The Scala ecosystem is chock-full of paradigms coming from static FP languages such as Haskell. Scala's features are actually very elegant and orthogonal. It does have ugly corners that are a result of its interoperability with its host, the JVM, but that's a tradeoff I like, because people that don't like the JVM, haven't seen what it can do.
On compilation speed, it's not much of a problem though I understand why people don't like it. But the type system is very static - and in comparison with Java in which the type system does nothing else but to stay in your way - in Scala it actually helps you to write code that is sometimes provably correct or to design safe and user-friendly APIs. For me it's not a problem if my code takes an extra couple of seconds to compile, because the compiler does help me in the case of Scala. In terms of recent developments, both SBT and Maven are doing incremental compilation. Plus, SBT makes it really, really easy to break your project into multiple sub-projects that depend on each other, to keep them small, something which helps with compilation speed though personally I do it for keeping the code base cleaner.
- yapcguy 13y agoCorrectness. Hmm. See other comments below where co-founder of Typesafe (who has quit) gave a talk explaining why Scala is doing everything wrong. In his video he has a slide with the words "No wonder nothing works" and on the slide: scala> val x1: Float = Long.MaxValue x1: Float = 9.223372E18 scala> val x2: Float = Long.MaxValue - Int.MaxValue x2: Float = 9.223372E18 scala> println(x1 == x2) true This is the guy who has worked on the Scala compiler. He says it will never be fast and there are things which are fundamentally broken (like above, and there are many more). I think any start-up using Scala is making a big mistake.
- noelwelsh 13y agoA Long is 64 bits. An Int is 32 bits. A Float is 32 bits (8 bits exponent, 23 fraction, 1 sign). I don't see how anyone could expect a Float to have enough bits to represent the difference. The only different behaviour I can envisage is an error, but it is standard practice to disable these for performance reasons.
- bad_user 13y agoA Float on the other hand, by definition, is only an approximation. You can use fixed-point numbers, but they are either too slow or lack the required precision. > val x: BigDecimal = Long.MaxValue Problem solved. Or is it?
- bad_user 13y ago> co-founder of Typesafe (who has quit) gave a talk explaining why Scala is doing everything wrong If that's what you've understood from that talk, then you haven't heard basically anything he said. > val x1: Float = Long.MaxValue OK, I'll byte, name your (safe for startups) programming language that presumably doesn't do that.
- lmm 13y agoThat's standard IEEE 754 floating-point behavior. Almost all languages will do that (and languages that use bignums by default have their own problems). If you want more accurate floating-point (at a cost in performance) you can use Spire. > This is the guy who has worked on the Scala compiler. He says it will never be fast and there are things which are fundamentally broken (like above, and there are many more). He also says it's the best language available at the moment. And he's right.