5 ms·
> There are so many problems with Scala, that the question of static vs. dynamic typing becomes secondary. Static typing could well be downright awesome, but Sc
by virtualwhys 13y ago
> There are so many problems with Scala, that the question of static vs. dynamic typing becomes secondary. Static typing could well be downright awesome, but Scala is still a mess.
Well, gosh, it must be terrible, avoid it all costs!
> I'm repeating the same line for the third time today.
You're obviously not a fan of the language if you find yourself bashing it 3 times in a day, fair enough.
> I find that Scala is for people who find Haskell too simple
Scala is for those that want to get shit done without dealing with Java's endless boilerplate, while still running on the performance beast that is the JVM and benefiting from Java's massive ecosystem. As a bonus you get FP out of the box, so you find yourself, without consciously being aware of it, favoring immutable constructs (map,flatMap,fold, etc.) over imperative mutable boilerplate ridden hacks to achieve the same, thereby, in complete disagreement with the article at hand, becoming a better programmer.
With Haskell you get purity, unhindered FP elegance, and minuscule ecosystem, a language interoperable with...itself it seems.
While it's true that Scala is perhaps overly feature rich, with the to be released 2.11 the focus has been on aggressively stripping out unused features from the language and improving compiler performance.
Following that, perhaps for 2.12, Odersky recently proposed on Twitter a revision of the type system that had FP devotees up in arms since the proposed change removes some of the complexity that makes libraries like Scalaz possible.
At any rate, with Java8 there will be a squeeze in the JVM landscape, alternative languages will be fighting for users as lousy legacy Java is soon going out the window.
- pron 13y agoAll the features you've mentioned (which are the only features 99% of Scala's developers want or use anyway) are found in Kotlin, without the crazy complexity. So occasionally you'll need to cast a reference; so what? Scala doesn't enforce safety anyhow, so why spend so much effort on removing each and every cast? What you've described is what Scala programmers want Scala to be, or what they use; not what it really is. It seems to me that you've actually described Kotlin. BTW, I agree that the JVM is a tremendous asset. I develop for the JVM every day and I love it.
- eropple 13y ago> Scala doesn't enforce safety anyhow, so why spend so much effort on removing each and every cast? Because then the computer knows what I'm doing, and not just me. Whenever I write a cast, I am assuming I'm smarter than my computer--so smart I never, ever need the computer to check it. This is pretty stupid, because I'm not that smart. (Neither are you.) > What you've described is what Scala programmers want Scala to be, or what they use This is a pretty silly line of demarcation. Scala is what people use. So is JavaScript. There's no prescriptive use case for it. I'd like to like Kotlin, but it wasn't done enough soon enough and I now know Scala intuitively enough that there's no real reason for me to use it. It's just-different-enough from Scala to throw me, while being a step back down the continuum of expressivity. If Kotlin had come out three years ago, it might have grabbed me, but at this point it holds no value to me.
- virtualwhys 13y agoYes, yes, Kotlin, we know, it's wonderful, such an amazing language...that does not yet exist. The reality is that Kotlin ships a milestone about every 4 months; they're still on 0.6 and the 1.0 release will be a beta release, so we can expect to see Kotlin stable in what, maybe 18 months? That's a long way away when you consider that... Java8 (arguably the bigger threat to Kotlin than Scala is) will already have launched (looks like Q2 2014 last I checked) and grabbed frustrated Java teams everywhere. So, Scala trimming down and Java fattening up. Kotlin? A bit late to the party. Java8 will keep existing Java shops intact, and Scala already having made significant inroads into the enterprise, will continue to thrive as _the_ statically typed Java alternative. My take at any rate, will be fun to find out how it all shakes out in the coming years.
- asdasf 13y ago>With Haskell you get purity, unhindered FP elegance, and minuscule ecosystem, a language interoperable with...itself it seems. As someone who switched from scala to haskell, I find your mis-characterization rather amusing. The haskell ecosystem is far better than the scala ecosystem. The ecosystem is more than just libraries, and using java libraries in scala is giving up much of the benefits of scala. And scala interoperability has been one of the biggest things everyone complained about, probably not a good choice to criticize other languages for. >Following that, perhaps for 2.12, Odersky recently proposed on Twitter a revision of the type system that had FP devotees up in arms since the proposed change removes some of the complexity that makes libraries like Scalaz possible. "Don't worry, they are going to make it 1% simpler by giving up 25% of its expressiveness!" is a pretty terrible sales pitch.
- virtualwhys 13y ago> The ecosystem is more than just libraries, and using java libraries in scala is giving up much of the benefits of scala. What does that even mean? There's full Java interop, so I just add a dependency on JodaTime and voila, a kick ass library at my finger tips. That is by and large the ecosystem, a massive wealth of functionality, followed by community and tooling (which in Scala is admittedly a weak point). With Haskell you have Haskell's ecosystem, nothing less, nothing more. So if a Haskeller hasn't developed, for example, a PDF generator to produce client invoices, you're SOL short of writing it yourself.
- asdasf 13y ago>What does that even mean? Scala has a strong, somewhat modernish type system. That protects against many bugs. Java does not. Java libraries can contain code that breaks assertions the scala language makes. >With Haskell you have Haskell's ecosystem, nothing less, nothing more Sure. But haskell's ecosystem is miles ahead of scala's. So it is less common to need to resort to using a C lib than it is to have to resort to using a java lib from scala. Yes, tooling and documentation are a huge part of the ecosystem, and scala is pretty awful in that regard.
- 13y ago
- anorwell 13y ago>Following that, perhaps for 2.12, Odersky recently proposed on Twitter a revision of the type system that had FP devotees up in arms since the proposed change removes some of the complexity that makes libraries like Scalaz possible. What is the proposed change, exactly? Do you have more information?
- virtualwhys 13y agoProposed change is here: https://github.com/strangeloop/StrangeLoop2013/blob/master/slides/sessions/Odersky-TroubleWithTypes.pptx?raw=true https://github.com/strangeloop/StrangeLoop2013/blob/master/s... and the Twitter thread is here: https://twitter.com/odersky/status/382833314286956544 https://twitter.com/odersky/status/382833314286956544
- abalone 13y ago> Scala is for those that want to get shit done without dealing with Java's endless boilerplate I've always wondered about this argument. Haven't modern Java IDEs more or less automated away the boilerplate? Using a tool like IntelliJ IDEA or even Eclipse for that matter, I'm really hard pressed to find something that could be autocompleted or generated that hasn't been. They even have views that collapse or otherwise hide away unnecessary verbosity. Sure, you have a little more code to look at. But frankly, sometimes this can improve readability vis-a-vis excessively concise and overloaded syntax. It can make it easier to grok someone else's code. I'm not saying there's no difference, just that it's a little odd that this is the NUMBER ONE advantage always cited for Scala vs. Java. Am I crazy?
- auggierose 13y agoYou are either crazy or maybe just not a very good programmer, if you think that tons of boilerplate is no problem because sometimes your IDE can generate / hide some of it for / from you.
- threeseed 13y agoBoilerplate code isn't just a problem for the person creating it. It's for the 20 people afterward who are going to be browsing, maintaining and adding new features on top of it. It is also lines of code that serve no purpose. And even the best IDEs can't help with much of what I've seen in large Java apps.
- eranation 13y agoYou are not, but subjectively I move more of my code to Scala, maybe java8 will change it, probably not. It's very much a personal choice. The easiest way is simply to write some code in Scala and get a feel for it. I prefer Scala because it's working for me, but everyone has different criteria and personal preferences. Go, clojure, Haskell might have more hype, but I tried them in the ultimate test of my productivity, and stayed with Scala. Because of my experience, not because someone convinced me in a comment or post. It's too subjective.
- saryant 13y agoI think the conciseness can improve readability. Consider these examples: List<String> list = getListofStrings(); List<String> capitalized = new ArrayList<String>(); for(String st : list) if(Character.isUpperCase(st.charAt(0))) capitalized.add(st); Or... val list = getListOfStrings val capitalized = list.filter(_.head.isUpper) Grokking two lines will take less time than grokking six lines.