14 ms·
Another Scala rant on HN
- octo_t 13y agoTo people who say Scala has too many features, which ones would you remove? (Please don't say + to concatenate strings, because everyone knows its terrible, its there for Java compatibility)
- lmm 13y agoI'd remove structural types. I don't see them being actually used in scala libraries, and I think "traditional" types provide a better replacement for most (all?) use cases.
- octo_t 13y agoDing ding! (That's the answer I'd give if someone asked me this question)
- octo_t 13y agoSo as i understand it the 'use case' is for coercing 3rd party types into your own type hierarchy. Suppose you had: trait Foo { def bar(): Int } and 3rd party library had final class FooBar extends java.lang.Object { public int bar() { /** **/ } } you could simply define your methods to take in a: type BarAble = { def bar():Int } But obviously if the library class is not final, you can simply do: type ThirdPartyFoo = FooBar with Foo ThirdPartyFoo <: Foo
- trailfox 13y agoRemoving structural typing wouldn't be an improvement to my mind. It's the sort of thing you use maybe once a year, but when you do it's extremely useful to have around. It's a bit like saying that removing the ternary conditional operator in Java would make a big difference to developers' lives.
- lmm 13y agoI think the kind of features you use maybe once a year are a bad thing to have in programming languages - ease of reading is more important than ease of writing.
- trailfox 13y agoI should also point out that it's a feature which I don't believe detracts from readability. It's pretty clear from looking at code which uses ST what it does. There are examples in this thread. It's a feature that you will use directly maybe once a year when adding it to a library, but I then use that library (and indirectly that feature) virtually every day. YMMV but we've found it very useful.
- deleted 13y ago[deleted]
- strictfp 13y agoRemove Java backwards compatibility.
- CmonDev 13y agoEasy - drop the JVM branch and continue the CLR branch. This way you could gain better performance as well.
- trailfox 13y agoBetter performance? What are you basing that on?
- CmonDev 13y agoVM-level support of generics, value types and tail call optimization. My knowledge could be outdated though. http://stackoverflow.com/a/267496/486561 http://stackoverflow.com/a/267496/486561 http://stackoverflow.com/a/480362/486561 http://stackoverflow.com/a/480362/486561
- MichaelGG 13y agoTail calls are actually rather un-optimized in .NET. F# avoids them as much as possible. F# used to emit tail calls any time it could, but it hurt performance. IIRC, tail calls were also ignored in many areas prior to v4 (and they still have some limitations IIRC). The JVM could implement tailcalls via analysis; the tail prefix isn't truly needed. But Xamarin's porting of Java to C# to run Android on Mono without the JVM did show a rather large perf increase. I'd assume that's mostly generics eliminating boxing.
- kvb 13y agoWhat do you mean by "The JVM could implement tailcalls via analysis"? Offhand, I can't see a way for this to be practically viable, but I may just be lacking imagination.
- weak 13y agoIf you asked me 6 months ago I would say the features that confused me the most: - Covariance / Contravariance - Implicit Parameters - Implicit Conversions - and also mentioned here, Structural typing. However now that i've spent time with the language, seen these in action and used them myself I see the reason why they exist and embrace them. I can see why this would be a common complaint against Scala and can be a barrier for a lot, but I think the language is worth investing time in learning, at least for me.
- pkolaczk 13y agoCovariance / Contravariance - Noooooooo! I admit - this might be hard to grasp at first, but in reality it is very simple concept that simplifies a lot of code. It is enough to get variance right once for a class, instead of fighting with ? in Java everywhere. BTW: Kotlin has copied it and noone complains it is too complex :D As of implicit parameters / implicit objects - ok, but what do you suggest as a replacement so that map/filter/reduce preserve types correctly? Or how do you do type-classes then?
- CmonDev 13y agoAgreed, Covariance / Contravariance was a fantastic feature to borrow from C#! It just should have been implemented to be friendlier to people new to language.
- firepoet 13y agoIs that where he borrowed it from? I've seen mention of the language feature showing up in Eiffel, Sather, and so on. http://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science) http://en.wikipedia.org/wiki/Covariance_and_contravariance_(...
- pkolaczk 13y agoEhm... No. If any, C# borrowed it from Scala. C# got them in version 4.0, which was first half of 2010. Scala had them since I remember (from day 1?) - for sure they were in Scala 2.6, which was released in 2006.
- RivieraKid 13y agoHave a look at Ceylon, my first impression was that compared to Scala, there's much more focus on readability, regularity and productivity. Ceylon is one of the 2 languages (the other isbJulia) that I find almost perfect.
- kasey_junk 13y agoIt's not so much about what I would remove, it's more about gaining guidance/acceptance/standardization around the "right" way to do various things. When creating a library should my functionality exist explicitly on the types? As extension methods on an implicit? As type classes? When should I use infix/prefix notation? When should I use . syntax vs no .? What does _ mean in this particular line of code? Is an allocation happening for this lambda or not? Why are map/flatmap/filter magical? Why are for comprehensions part of the language for those but not for type classes? All of these kinds of questions are really hard to answer and I've been programming Scala in production for years. Other complaints I have are about the mess that is the collections library, the push for actors when they are generally a bad solution, an emphasis on algebraic types without providing Union types, and all the opportunity costs represented in sbt (which is finally passable but no better) and Scala IDE. Don't get me wrong, if you are targeting the JVM & want strong typing (I do), Scala is the best language for the job, but even for someone who uses it every day and is pretty expert there are some confusing corners & no 2 developers seem to write code the same way, so there is a price to be paid for that.
- scotth 13y agoWow, I have never heard anyone talk about actors that way, but have often thought it myself. What makes you say this?
- kasey_junk 13y agoI have 3 major complaints about actors (specifically Scala/Akka actors, but most of the models I've encountered have similar problems). 1) In general, I think that going parallel should be an architectural decision. On current commodity architectures it doesn't buy people as much as they think it does, and can in many cases over complicate code. Actors hide this complexity, but don't actually remove it. People think actors give them free license to add tons of threads when they shouldn't. 2) Actor code tends to mix business logic with threading logic, precisely what we should be trying to avoid. 3) The actor model subtly conflates publisher/consumer models which tend to decompose and perform better in parallel situations. Normally, for calculation style parallelism I prefer future/promises and for event style parallelism I prefer single writer/multiple consumer based shared memory.
- Pxtl 13y agoPython, C#, all the Java-derived languages... basically every C-ish syntax language except for C/C++ itself use + to concatenate strings. And it's an intuitive concept too - adding two strings is concatentation. That makes sense. The problem isn't + string-concat, it's silently casting numerics into strings. "foo" + 6 + 6 Should be a compiler-error.
- krapp 13y ago"foo" + 6 + 6 >Should be a compiler-error. Why? "foo" is already a string, getting "foo66" from that makes perfect sense to me. 6 + "foo" though would be crazy.
- wiradikusuma 13y agoI use both Scala and AngularJS, and I feel like they seem to be in a similar position in terms of acceptance (negative and positive). The funny thing is, even for negative posts (bashing etc), I upvote them in HN. My intention is obviously for the technology to improve, or for people to clarify FUDs.
- mtrimpe 13y agoIt's interesting because I found the original article quite vapid, but the takeaway of the top two comments of the discussion quite enlightening: the exact same set of features sound like heaven to some and hell to others. Perhaps Scala is the Napolean Dynamite [1] of programming languages. Personally I'm also indecisive about Scala because while I'd take Scala over Java any day; I'm still hoping that something more elegant will become the next 'enterprise standard' (and I'll be programming Clojure instead whenever I get the chance.) Scala reminds of the saying that just because the American SUV is the most elegant solution for making a family vehicle that looks masculine; it still doesn't mean they're not ugly. Scala feels a bit like that SUV: Just because it's the most elegant solution to getting something Haskell'ish shoehorned into the JVM still doesn't make the end result elegant. [1] http://www.nytimes.com/2008/11/23/magazine/23Netflix-t.html?pagewanted=all http://www.nytimes.com/2008/11/23/magazine/23Netflix-t.html?...
- deleted 13y ago[deleted]
- CmonDev 13y ago"something more elegant will become the next 'enterprise standard'" - C# is both.
- mtrimpe 13y agoAssuming F# is included I actually agree with that to a large degree except for the fact that the division between C# vs. OSS languages is more ideological than anything else.
- talloaktrees 13y agoI think the ideological part plays a big role in keeping people away from C#, unfortunately
- pjmlp 13y agoOnly in places like HN, in the enterprise world we are not short of .NET projects.
- buster 13y agoTBH, i don't see so many Scala rants on the HN frontpage (surely not every week). It's kind of amazing how people take some little blog rant of some random stranger so personal and a whole community debates about it..
- darklajid 13y agoI'm positively surprised. Given the headline, the cause for that thread, I expected a heated debate, laying blame everywhere. Instead I found a reasonable (if a bit defensive - if Martin is the creator of Scala I can totally understand that) poll for ways to improve Scala's flaws and image problems. The discussion was mostly a very good read as well. I haven't written a single line of Scala in my life (I'm a fan of Clojure and F# to some degrees), but this thread looks gives me the impression the Scala community is mature and open. Basically that thread managed to offset a number of "Scala's not working for me" reports by itself.
- teacup50 13y agoI really appreciate that Scala has a mature, rational, even-keeled community.
- StavrosK 13y ago> if Martin is the creator of Scala I'm not sure if you're saying "If the person who goes by the name of 'Martin' in the list is Martin Odersky, the creator of Scala" or "If this 'Martin' guy is the creator of Scala". In both cases, this seems to be a yes, since Martin's email address on the list begins with "ode...@".
- rz2k 13y agoI think its more like "if three is prime...", where there isn't doubt that Martin is the creator, but that being the creator makes being defensive understandable.
- gcv 13y agoA lot of messages on that thread boil down to "haters gonna hate; ignore them!" Luckily, it seems that Martin Odersky is taking good criticism to heart. His post makes it clear that he is listening to people's concerns and wants to do something about them. It'll take time, of course. Scala has gone a long way from the first time I looked at its predecessor, Pizza.
- trailfox 13y agoThe quality of the original "1-star" blog post was extremely low. Odersky sums it up well with: This week-end's edition is called "Scala - 1 Star - would not program again", and it's by someone who from reading his post seems to have written Scala all of two weeks after coming form Javascript. I think the interesting bit is not so much that these posts are written, but that they are upvoted so much. I was also very surprised to see such a low-quality blog post being voted up with such enthusiasm on HN and elsewhere.
- mattgreenrocks 13y agoPeople love controversy, and Scala is relatively new/unknown. But the fact that the article got disseminated so widely speaks volumes about the need for curation. Delegating it to users simply ensures it meets a certain minimal threshold.
- nilliams 13y agoAlso be aware that people like myself that don't know much about Scala, but are trying to keep it on their radar, may upvote such a post just to try and see where the comment thread goes and see if there are good insights from the defending community. Often an upvote doesn't mean I agree with the post or even its tone. Just that I want to see some further discussion. (I don't know if this is in the spirit of HN, I appreciate it must be maddening for some people to see 'low quality' posts get upvotes).
- taude 13y agoI thought the discussion the prior article created was really useful. Learned many things, including some things to look out for while evaluating, and other languages that people seem to like.
- adamors 13y agoI feel the same way, sometimes I upvote controversial articles because I'm interested in the discussion it sparks.
- 13y ago
- ngcazz 13y agoSay what you want about Scala, this kind of modesty and openness to criticism is quite uncommon in IT! Maybe it's the academic background...
- eklavya 13y agoI don't use LISP languages, I haven't tried them mostly because I really don't like "()", but I do know they are loved by those who use them. They must be good. People say that you get used to it in a while. Now what I won't do is try to apply all the patterns I have learned over the time and try to force it on a LISP language and then say that it is shitty because x. I would rather take some time to learn the LISP way of doing things and be more enlightened for having done so. Of course Scala is heavy on types. It is advertised as a feature! why the surprise? Why won't you come along with us and try to do things our way once and see if you like it?
- edem 13y agoBecause that way is littered with rotting corpses ravaged by baroque syntax monsters.
- Sandman 13y agoOne thing I noticed about Odersky is that he is very protective of his creation (which is understandable, to some degree). He defends Scala against any and all criticism with a fervor, and this puts him in sharp contrast with most of other language creators who seem to be able to accept critique (or even plain old language bashing) much more calmly. So some guy wrote a blog post about how he doesn't like Scala, so what? People complain about Java all the time, imagine if every time that happened, James Gosling wrote a blog post bitching and moaning about it.
- trailfox 13y agoI would argue the exact opposite. Odersky has gone to great lengths to discourage overly defensive commentary and bashing of other languages: http://www.scala-lang.org/old/node/12498 http://www.scala-lang.org/old/node/12498 I don't think it's unreasonable to respond to a very poor quality blog post bashing Scala since it received very widespread publicity. The interesting story behind the story is the extreme enthusiasm with which Scala bashing posts are upvoted on various forums. It's highly unlikely that the majority of those voting have actually used Scala.
- MetaCosm 13y agoDespite that post for tolerance of other JVM languages, I still found the linked (original) thread a type of toxic community I haven't exactly seen before. Peppered with great posts, but overall, disturbing. Self-important to an extreme (We are a threat to them .. mentioned dozen+ times), often describing people who don't like Scala as either lazy or defensive. The concept that someone could be very adept at Scala, and still think it isn't a good language (and set of important libraries) is simply a non-starter for them. That type of fundamental arrogance in a community so young is bad news -- and it appears to come right from the top. On the upside, there was at least begrudging acknowledgement that issues actually exist.
- taude 13y agoI don't know....it seemed to work for the Ruby on Rails community. :)
- jheriko 13y agoi have to admit i do mildly write it off as yet another hipster language we don't want or need... but i do have a curiosity to see what all the fuss is about. i can imagine a fair amount of negativity coming from app and system developers thinking "oh god, not yet another story about yet another hipster web dev language we don't need... yet again! when will web developers ever learn! when will i get a language /i/ want..." i'm sure it is great for some domain, but i've yet to really play with it or find myself wanting it somewhere. to be fair, most of my language excursions away from c and c++ are from either pure curiosity or a platform holder ramming it down my throat.
- static_typed 13y agoWell, Martin should be happy Scala is getting discussed, even if he doesn't agree all that is being said. There are plenty of new and old languages that never get a mention on HN, let alone grace the front page. That said, he should probably not take any criticism personally. They are discussing Scala the language, not Martin the creator of that language.
- frowaway001 13y agoThere was at least one person which did not only attack and insult him, but went straight from HN to the mailing list to do so. I don't think this makes HN look good in any way.
- deleted 13y ago[deleted]
- pron 13y agoAs someone who "bashed" Scala numerous times in HN comments, let me explain why, but first, a bit about my background: Nowadays I program mostly in Java and some Clojure; before that, I developed in C and C++ for many years. I like both the OO and the FP approaches, and I am all in favor of incorporating FP concepts into OO languages (Java 8 lambdas) and vice versa (Clojure protocols). I think that as a research language Scala is very important. It meshes features found in many different languages (OO types, algebraic types, duck-typing, macros) into one compiler, and so teaches us a lot about how these features can interoperate. But Scala wishes to be a practical language as well. As such, I think it is an exceptionally badly-designed language (which does not, in itself, merits bashing) that masquerades, or claims to be, a well designed one, and herein lies the problem. As Rich Hickey so eloquently puts it in one of his talks[1], a programming language is like a musical instrument. Every instrument has properties that introduce constraints. A trumpet can only play one note at a time, while a piano has very limited sustain. These constraints do not limit the artistic expression of the instrument – they assist it. An instrument with no constraints is a "choose-a-phone", and as Rich Hickey says, no one wants to play a choose-a-phone. That is not to say that a rich piece of music cannot be composed for a piano-and-trumpet ensemble. In fact, the JVM, which Scala targets, is the perfect language-ensemble tool, as it offers a harmonic interoperation of different languages of different kinds. Scala is the ultimate choose-a-phone language, with little or no constraints. When it removed the constraints by mixing all these disparate features, it lost most of their underlying justifications. It adopted JavaScript's duck-types but lost the simplicity of the language; it adopted Haskell's algebraic types, but lost the control over side-effects; it adopted Java's OO types, but again, lost their static-type simplicity. But JavaScript uses duck typing because it can keep the language itself dead-simple and easy; Haskell uses those sometimes-hard-to-grasp algebraic types because they offer safety and carefully controlled side-effects; Java has a basic OO type system because it offers some safety while keeping the language relatively simple. Scala takes these features but drops their reasoning; in the process it lost its coherence. So the challenge of programming Scala turns from the challenge of simply expressing your artistic ideas with your chosen instrument into keeping yourself in line without those helpful constraints. It makes playing a harmonious melody difficult. Scala masquerades as a well-designed language because it includes all of these modern, cool, features. Each of these features is well designed. But putting all of them together is the opposite of good design. The whole, in this case, is much less than the sum of its parts. All this is not purely philosophical. Languages like Clojure and Erlang tell the programmer "this is how you should write software", and if you need to do something else, you should integrate Java or C code. Scala, on the other hand, offers little guidance. Immutable and mutable variables are just as easy to declare; the "expression problem" is sometimes solved using OO and sometimes FP. As a research language - that's great; as a practical language, it can be destructive. It is also wasted effort. While it is certainly true that sometimes "named types" are better while other times duck-typing is more convenient, or that sometimes you want simple mutability and sometimes you don't, or that sometimes pattern matching is better than polymorphism and sometimes the other way around, in 99% of the cases, either of these approaches works well. Good, working, efficient, complex software has been written in Java, Haskell, JavaScript and Lisp. Combining all those features into one language creates big, largely unnecessary, overlaps in functionality that mostly cause confusion. This wasted effort is not just a waste; it is downright harmful, because Scala has become a very complex language. So complex, in fact, that no one but veteran Scala experts can understand how Scala's linked-list is implemented. It is also unnecessary because, as I've said, the JVM is a multi-paradigm environment. If one paradigm is better than another for different parts of your software, you can write parts of it in Java, others in Clojure, others still in Erjang, and others in Frege. Even then you'll find that one, simple, language is perfect for 98% of your project, while another simple language is the best fit for the remaining 2%. I think Scala's designers are stuck in their PL-research point of view. It is immediately apparent that Scala is not a language that grew from developers' needs and problems (like Clojure and Erlang), but from a PL experiment. Some years ago it might have been OK to overlook much of Scala's complexity and use it as "a better Java". Now, Scala has become ever more complex, and at the same time, better designed practical languages for the JVM have shown up. Given the wide choice, I think Scala is now a particularly bad option for a practical JVM language, especially if you're working in a large team, as every complicating language feature causes compounded damage as the number of developers on your team grows. [1]: http://www.infoq.com/presentations/Design-Composition-Performance http://www.infoq.com/presentations/Design-Composition-Perfor...
- fat0wl 13y agoif you are watching, modersky, please appreciate that a big reason these articles get upvoted is because people want to discuss Scala. many of the comments are positive :D i for one see value in Scala, for many of the reasons outlined here, though I am experimenting and thinking it through for myself. the more interaction i have with it the more i see it as a marriage of several great worlds. One could argue that this makes for a jack-of-all-trades scenario. but let's be honest, that is what the web world seems to be demanding. & now, to fan the flames the tiniest bit -- when I was in the RoR ecosystem it made me absolutely sick how fervently the user-base seemed to glorify and idolize it. Go to any random blog post on the internet that paints Rails negatively and you will see a stream of tl;dr comments defending it that have almost NO technical basis. just my experience anyway... and in many cases all they seemed to be defending was syntactic sugar, a tangled web of OO, and mediocre gems. But my real disappointment was that the culture of convention seemed to be a cultural of programming ignorance and non-education. This does not mean I hate RoR, since these discussions are irrelevant. But the point is that I appreciate that Martin's views are at least rooted in programming philosophy rather than hype-mongering for or against. Scala is a student's language at the very least, whereas many other popular web languages are an uninspired grouping of OO conventions. He seems to want to educate, moreso than proselytize. Perhaps this simply makes him the devil's advocate but I see the potential for Scala to be much more than an exercise. And if some other JVM language gets a better foothold, I doubt Mr. Odersky will mentally implode. I expect more Scala ecosystem advancements far into the future.
- anatoly 13y agoThe first message in the thread, from Martin, really surprised me with its absolute lack of awareness of selection bias: >Seems hardly a weekend goes by these days without another Scala rant that makes the Hacker news frontpage. [...] There certainly seems to be a grand coalition of people who want to attack Scala. Since this has been going on for a while, and the points of critique are usually somewhere between unbalanced and ridiculous, I have been curious why this is. I mean you can find things that suck (by some definition of "suck") in any language, why is everybody attacking Scala? Why do you not see articles of Rubyists attacking Python or of Haskellers attacking Clojure? He doesn't appear to even consider the possibility that he might be noticing the anti-Scala rants more readily than rants against other programming languages. Not having considered the possibility of the bias, he has no chance to try and correct for it. The wildly distorted impression he's formed leads him to language bordering on conspiracy theories ("grand coalition of people who want to attack Scala"). There just haven't been that many anti-Scala posts and discussions. Perhaps a bit more of them in the last two years, but not an avalanche by any means. Meanwhile, every language Martin's mentioned has been getting its share of attacks and (mis-)representations. Seriously, Zed Shaw's "Rails is a ghetto" rant alone has been more discussed and disputed and reblogged than _all_ of the anti-Scala posts put together, I'm sure. Selection bias is incredibly pervasive, and you invariably succumb to it unless you consciously remember to be aware of it and try to correct for it (and then you succumb anyway, but hopefully to a lesser degree). It surprised me that Martin Odersky seemingly didn't realize that.
- sheetjs 13y agoA cursory search for scala stories shows glowing scala stories appearing far more frequently than criticisms As for selection bias, keep in mind that many sharp people can be insecure. It's natural. But the best and brightest are able to cut through the criticisms, recognize the underlying issues, and react accordingly.
- laureny 13y ago> He doesn't appear to even consider the possibility that he might be noticing the anti-Scala rants more readily than rants against other programming languages. Not having considered the possibility of the bias, he has no chance to try and correct for it. The wildly distorted impression he's formed leads him to language bordering on conspiracy theories ("grand coalition of people who want to attack Scala"). What makes matter worse is that he posted his rebuttal on the scala-debate mailing-list which was quick to support his points and reinforce him in his misguided conception that 1) there is a conspiracy against Scala and that 2) the problems brought up by naysayers can be safely ignored. Martin simply can't admit that people criticizing his language might actually have good reasons to do so, instead, he just dismisses them and files them in the category "too lazy to learn" or "threatened by Scala".
- oscargrouch 13y ago>For me the main reason is that programming languages are incredibly tribal and Scala has no traditional community This is the pure essence, of why people here at HN love or hate some language/technology As a experiment, try to talk badly about javascript or anything from apple The community here are completely biased, and its all about hypes.. any technology that require more effort and dont make the guy looks like a genius in 5 minutes of programming is not worth it in their view.. its not a problem with the language, its a problem with the community.. Its the generation of "genius: cooked in 15 minutes" nevermind the bollocks
- omni 13y agoEvery single post about JavaScript is filled with people in the comments talking about how much they dislike JavaScript. Not sure that's a great example.
- oscargrouch 13y agoYes, but that is after 2 or 3 post javascript related (javascript + javascript libraries) being upvoted everyday My point is, there is a cult.. and thats what make the rating mechanism so unfair with other technologies that are not the mainstream ones I saw it happening with Java, now its Javascript.. and soon will(probably) be Go yet, they are all the same paradigm of C.. some sintax sugar here, some FP there.. yet.. same paradigm.. nothing that would make you create something never seen before in other language.. just more noise and vanity
- Estragon 13y agoFrom the thread in the OP: ...to exploit the real power and appreciate design choices takes months if not years... It sounds like the benefits of Scala are very subtle, and I would love to read an informative overview of them and why they are hard to master.