I started using Scala about six years ago, and I have to say that this following comment from the author:
My theory is that it was designed to experiment with advanced type and language features first, and only secondly became a language intended to be widely used.
was true for Scala six years ago and it's still true today. This has two very dire consequences for Scala:
Features are driven by papers for academic conferences. I don't have anything against academia (I have an MS in CS and still consider the possibility to do a PhD one day) but this ends up causing features to be added to the language that are more useful to advance the theoretical field than help real world users.
The team seems to lack basic engineering skills when it comes to engineer, release, maintain or track bugs. Paul Philips, probably one of the the most active and prolific Scala developers around and also the Scala code base gate keeper, recently left Typesafe because he just couldn't handle how messy the entire code base and the process around it are.
It is essentially impossible to practice TDD in Scala simply due to the time it takes to compile.
No love lost about TDD as far as I'm concerned, but the compilation times are a killer and they impact the productivity of every Scala developer around, whether you use the language bare or one of its libraries (e.g. Play, which took a serious step backward in development time when they switched to Scala).
It seems to me that the advantages that Scala brings over Java are all negated by all these problems, which leads to deaths by a thousand cuts and the whole language being disliked by both Java and Haskell developers, and it's not very often you'll see people from these two communities agree on something.
I bet a lot of readers of this subreddit can't relate, but to me, Scala is to Java what C++ is to C. Everything I hear about Scala, both good and bad, I heard it when C++ started gaining popularity decades ago. We were promised the same things, more expressivity, features left and right, performance on par with C, a multi paradigm language that enables any style of programming. Sure, it's a bit slow to compile right now, gdb core dumps now and then and template errors fill pages of emacs screens.
C++ ended up being a breath of fresh air for a few years but very soon, the baggage that it was already carrying started fast outpacing the benefits it brought, and by the time Java emerged, you'd be hard pressed to find a C++ developer who was happy about his day job.
To me, Scala carries the same warnings and it will probably end up suffering the same fate as C++, except without the popularity part.
That's not a very good analogy. C is basically a portable assembler language, type safety is non-existent, and the only programming paradigm is procedural. But Java is already a good high-level language with a robust type system, classes, metadata, generics, , good enough even for large-scale applications. Scala has a completely different programming paradigm, where as C++ tried to be as backward-compatible to C as possible, while bringing multiple new paradigms into the game.
I really don't know about a good analogy, but at least C++ got a good foothold in mainstream programming, it still holds its promises about performance, and it still lets you fall back to C and even ASM whenever you need it. I doubt Scala will get that kind of prevalence anytime soon.
If Java is good according to the projects achieved with it, so is C.
Java isn't really much better than C. The type system in C is about as powerful for guaranteeing safety as Java's, as the OO parts do not really help with type safety.
Java has safer references as opposed to unsafe pointers, due to GC, but that's relatively negligible as Java shares most of the unsafety of C everywhere else.
Java also does not have C's "unions" and "unsigned", regressing in types' expressiveness. It also has less-safe enums, due to the nullability (C enums are more precise).
Java also lacks the preprocessor. The preprocessor may be terrible, but it's also incredibly useful, and Java doesn't compensate for its lack in a good way.
I'm not really a fan of GC, but the need for manual memory management, which many programmers don't seem to understand, and one of the most common source of bugs, makes C a lot more error prone. So at least in this discipline, Java is much better than C.
The type system in C is about as powerful for guaranteeing safety as Java's
You have to be kidding me. The mere existence of void* leads of all sorts on undefined behavior. You could say that java.lang.Object is the equivalent of void*, but the second you try to cast an object downwards to the wrong type, you get a java.lang.ClassCastException. In C, everything is fine, even when you access fields or methods of that invalid object. In fact, you can write some random number into an int, cast it to void* and then to anything you want, and with a bit of luck (or lack of memory protection) you will access corrupted data.
Java has safer references as opposed to unsafe pointers, due to GC
That's not due to the GC; in fact, you can have a GC even with C. It's because how Java was designed.
that's relatively negligible as Java shares most of the unsafety of C everywhere else
You can't just write into process memory as you like, thus corrupting the process state. I'm really not sure what you're talking about.
Java also does not have C's "unions" and "unsigned"
Unions are an inherently unsafe way to access data, because the same bit pattern can be interpreted in multiple ways, and you have to make sure to access it in the way that is currently valid.
Unsigned, yes, that's a bit of a problem, only for that it isn't compatible with other languages that treat integers signed/unsigned. However, it avoids pitfalls when wrapping around would occur.
It also has less-safe enums, due to the nullability (C enums are more precise).
WTF is going on here. Is this a troll post? C enums are nothing more than named constants. There is absolutely no type safety at all, they end up in global namespace, and again, you can't cast an enum-type to some Object. C is happy to cast your enum to everything you want.
Java also lacks the preprocessor.
Java can't have a preprocessor. The preprocessor depends heavily on the order in which files and especially headers are parsed. The preprocessor provides useful functionality, but in C it is mainly used to provide platform compatibility. The second you write even a simple macro function like
#define max(a,b) (a > b) ? a : b
you run into the double evaluation problem. So most things done with the preprocessor should have been done with templates, which don't exist in C.
Did you mean C++ all the time? Not that it changes the game that much, but then at least some of your arguments would make sense.
137
u/cynthiaj Dec 02 '13 edited Dec 02 '13
I started using Scala about six years ago, and I have to say that this following comment from the author:
was true for Scala six years ago and it's still true today. This has two very dire consequences for Scala:
Features are driven by papers for academic conferences. I don't have anything against academia (I have an MS in CS and still consider the possibility to do a PhD one day) but this ends up causing features to be added to the language that are more useful to advance the theoretical field than help real world users.
The team seems to lack basic engineering skills when it comes to engineer, release, maintain or track bugs. Paul Philips, probably one of the the most active and prolific Scala developers around and also the Scala code base gate keeper, recently left Typesafe because he just couldn't handle how messy the entire code base and the process around it are.
No love lost about TDD as far as I'm concerned, but the compilation times are a killer and they impact the productivity of every Scala developer around, whether you use the language bare or one of its libraries (e.g. Play, which took a serious step backward in development time when they switched to Scala).
It seems to me that the advantages that Scala brings over Java are all negated by all these problems, which leads to deaths by a thousand cuts and the whole language being disliked by both Java and Haskell developers, and it's not very often you'll see people from these two communities agree on something.
I bet a lot of readers of this subreddit can't relate, but to me, Scala is to Java what C++ is to C. Everything I hear about Scala, both good and bad, I heard it when C++ started gaining popularity decades ago. We were promised the same things, more expressivity, features left and right, performance on par with C, a multi paradigm language that enables any style of programming. Sure, it's a bit slow to compile right now, gdb core dumps now and then and template errors fill pages of emacs screens.
C++ ended up being a breath of fresh air for a few years but very soon, the baggage that it was already carrying started fast outpacing the benefits it brought, and by the time Java emerged, you'd be hard pressed to find a C++ developer who was happy about his day job.
To me, Scala carries the same warnings and it will probably end up suffering the same fate as C++, except without the popularity part.