5 ms·
While I can't speak of traction in enterprises in Germany, I wonder what the notion of "Scala with its everything and the kitchen sink feature set" is about. T
by happy_dino 13y ago
While I can't speak of traction in enterprises in Germany, I wonder what the notion of "Scala with its everything and the kitchen sink feature set" is about.
This seems to be a popular meme, right until someone asks for details – crickets chirp.
- qammm 13y agoWell, with "Scala with its everything and the kitchen sink feature set" I mean that Scala incorporates almost all language features one can think of for a statically compiled programming language (I don't think it makes sense to distinguish if a certain feature is provided by the language itself or a library as in Scala that distinction is fuzzy): - type inference - classes - interfaces (sort of: traits) - methods - variables (var) - immutable values (val) - higher order functions - singletons - functional programming: map, flatMap, reduce/fold, ... - actors - coroutines (I think there was a compiler plugin for that) - implicits - powerful type parameters - Futures - it even has a turing complete type system That is good and bad. Good: you can probably find good use for every feature Scala has. Bad: On a sufficiently big project with one or more extra clever developers most probably every feature will be used and that will make it extra hard to understand for normal software developers that have to maintain it for long years after the original extra smart developer already left the company. See it a bit like that: On a hard to understand scale with 1 being easy to understand und 10 being extremely hard to understand Java projects can go from 1 to 6 and Scala projects can go from 1 to 10. Personally I like simple languages more. And I don't need a compiler to catch errors that a unit test would also catch.
- happy_dino 13y agoI guess it depends on where one comes from. If one compares Scala to Scheme, sure, Scheme is ridiculously simple compared to Scala. But if one compares Scala to languages which are actually used in the wild like Java, C#, PHP or C++; Scala's footprint is just incredibly small. All of the features you mentioned are available in languages like Java or C#, too. The difference is that in most cases the implementation is so poor and incoherent, that the feature is next to useless. I guess one just "sees" more language features being used in Scala, because almost everything which ships in the language makes some sense, while in Java/C#/PHP/C++ you have tons of utterly useless "features" which don't add any benefit, but still force people to learn them in case somebody else used them. I have never seen "On a sufficiently big project with one or more extra clever developers most probably every feature will be used" happen in real life. In my experience one of the strengths of Scala is the way one can use some advanced feature where it makes sense, without having it bleed through the whole code. Compare that with Java's, C#'s "Oh, you used some complicated Generic type over there? Guess what, we will make every user suffer from it throughout your whole code base!" In a sense, I prefer a language (Scala) which ships with 100 features where 90 of them make sense to a language which ships with 400 features where only 50 make sense, like C# (multiply "feature" count by 10 for C++). > And I don't need a compiler to catch errors that a unit test would also catch. Well, using the compiler means that it will also catch errors which you haven't written unit tests for. Tests can't prove the absence of certain categories of errors, compilers can.
- qammm 13y agoI don't want to sidetrack that thread as it was about Clojure. Just a quick correction: Java has no type inference, higher order functions, coroutines, implicits (it has some standard implicit conversions but not implicit conversions that can be added by the user) and no Turing complete type system. And of course: Using a statically typed language is no excuse to not write unit tests. Unit tests serve as a safety net checking if the behavior of the implemented unit is (and stays) correct. As a side effect this will also find all type errors a compiler will find. I have programmed a lot in Java and also in dynamic programming languages and in my opinion type errors just don't happen often enough to justify the additional amount of work and complexity that comes with static type systems. However I'd agree that if you want to get the best possible performance you probably need a statically typed language as the compiler can then optimize the generated code better.
- happy_dino 13y ago> Java has no type inference, higher order functions, > coroutines, implicits (it has some standard implicit > conversions but not implicit conversions that can be > added by the user) and no Turing complete type system. Type inference in Java: int bar = new Object(){ int foo = 42; }.foo; // Magic? No. Type inference. Higher order functions in Java: http://download.java.net/jdk8/docs/api/java/util/stream/Stream.html Looks pretty higher-order to me. Also possible in older version in Java with stuff like Google Guava or FJ. Coroutines in Java: http://stackoverflow.com/questions/2846428/available-coroutine-libraries-in-java Implicits: Having them built into the language is even worse. In Scala you could just de-import them and have them gone. Anyway, pick C# as an example instead if you want to have user-defined implicit conversions. No Turing complete type system: interface Interface<T> {} class Bang<T> implements Interface<Interface<? super Bang<Bang<T>>>> { static void bang() { Interface<? super Bang<Byte>> bang = new Bang<Byte>(); } } Looks pretty undecidable to me. In a way, it is even worse than other languages: You are unable to tell whether the type checker will terminate in finite time (like some other languages), but don't get any additional expressivness in return (unlike those other languages). > As a side effect this will also find all type errors > a compiler will find. No, absolutely not. > I have programmed a lot in Java and also in dynamic > programming languages and in my opinion type errors > just don't happen often enough to justify the > additional amount of work and complexity that comes > with static type systems. This comment certainly explains a lot. You are suffering from the "I used Java and Java is statically typed and it sucks, therefore all statically typed languages have to suck" fallacy.
- sultezdukes 13y agoAnother bitter Scala fanboy that goes trolling other language threads looking for any mention of Scala and who is very angry that Scala isn't taking off and never will. That's the thing about the Clojure community. It doesn't have wackjob fantatics like you.
- happy_dino 13y agoLooks like you just managed to disprove my earlier claim: > Before I learned about Clojure, I certainly wouldn't have > believed it if someone told me that there was a Lisp-like > language without the pretentious assholes. Too bad.
- sultezdukes 13y agoYou guys troll over at Reddit too. Just the mere existence of Kotlin has gotten you and/or some of your compadres into a complete meltdown. Is this your fulltime job, or are you a part-time "Scala Defenders Brigade"? It's hilarious watching you clowns. Any criticism (real or perceived) or Scala, and you get your panties all bunched up in a knot. Scala must be in big trouble. You better redouble your efforts.