News for hackers. Stuff that matters.
Re:Why There Is Interface Pollution in Java 8 by pron on Sunday September 28, 2014 @07:27PM (#8381180)
It's (almost) just as bad when you try to manage lots of dependencies.

> but for such a large code-base I think building dependencies from source ... is probably not a bad idea.

That's a bad idea. You want to manage as little code as possible, especially given the already large codebase. It's certainly doable, but in the end you realize the benefit is just not worth the effort.

Of course, that was just a symptom of a far larger problem: It always seemed that when faced with the dilemma of favoring some PL research goal vs. real working-man's use, Scala always chose the former; it was like its real (though not stated) target audience were PL PhDs. It seems the winds have shifted recently, but probably too late, and Scala is already weighed down by too many "PhD" features that need to be removed in a way that would severely break source compatibility.

Say what you want about Java, it's really great for big projects you must depend on and need to maintain for many years.

Re:Why There Is Interface Pollution in Java 8 by rtpg on Sunday September 28, 2014 @09:26PM (#8381363)
>It's certainly doable, but in the end you realize the benefit is just not worth the effort.

The benefit of using a language that, at _worst_, is as productive as Java, and at best miles better?

>faced with the dilemma of favoring some PL research goal vs. real working-man's use, Scala always chose the first

Scala is pretty straightforward in terms of features, classifying it as "PL research" is a bit much.

>Say what you want about Java, it's really great for big projects you must depend on and need to maintain for many years.

My experience has been that larger projects end up accumulating so much boilerplate that it becomes extremely hard to manage (I fear that Scala's standard library is becoming like this too, but third-party libs seem to avoid this).

I have trouble finding any non-deployment-related argument against Scala in the Scala vs. Java comparison.

Re:Why There Is Interface Pollution in Java 8 by pron on Sunday September 28, 2014 @11:07PM (#8381553)
> The benefit of using a language that, at _worst_, is as productive as Java, and at best miles better?

I completely disagree with this. If "productive" means fewer lines of code -- then yes. But for a large-scale project, productive usually means code that another developer can understand quickly, and by that metric I think Scala loses big-time.

> I have trouble finding any non-deployment-related argument against Scala in the Scala vs. Java comparison.

Then either you haven't had enough experience with Scala (not on your own, but in a large team[1]) or you haven't looked. I and many others can list plenty, but I've said much of that before, and you can find a lot of other people's experiences online. In the end, it all comes down to tradeoffs, and you can find many valid arguments for both preferences.

[1]: It can be argued that almost no one had (and neither have I) because Scala hasn't been around long enough, but overseeing development of (non-Scala) software that needs to last for at least a decade, as well as the later evolution of similar projects, it quickly became clear (to me, at least) that Scala isn't a great fit for such projects (at least not for many developers). People had a harder time understanding Scala code that was written by another team member a week earlier than Java code written 7 years earlier. While you certainly can be too clever in Java if you put in enough effort, it's waaay to easy in Scala. You can immediately see how the programmer became too bored of the actual problem they had to solve and decided to amuse themselves by playing with the language. This is something I've seen happen in C++ projects too, but to a lesser extent. I can guess that part of the reason is that when almost everyone was using C++, the internet, and certainly blogs, weren't so widespread and influential, so the really clever tricks couldn't spread so quickly. Also, when C++'s harm became apparent, discipline was quickly enforces in many organizations, and it was much easier to enforce discipline over C++ developers back then, than over Scala developers today, because many of those are cowboys to begin with. Still, maintaining long-lived C projects is easier than maintaining C++ projects, so much so that many wish they had chosen C over C++ when they first began development.

Re:Why There Is Interface Pollution in Java 8 by justinpombrio on Sunday September 28, 2014 @11:49PM (#8381623)
> Scala is pretty straightforward in terms of features, classifying it as "PL research" is a bit much.

False.

http://www.scala-lang.org/old/node/143.html#papers

Re:Why There Is Interface Pollution in Java 8 by frowaway001 on Monday September 29, 2014 @10:32AM (#8382985)
http://citeseerx.ist.psu.edu/search?q=java&submit=Search&sor...

    Results 1 - 10 of 119,620
What's your point again?
Re:Why There Is Interface Pollution in Java 8 by justinpombrio on Monday September 29, 2014 @03:23PM (#8384688)
Ah, the difference is that much of the research done on Scala makes it into the language
Re:Why There Is Interface Pollution in Java 8 by frowaway001 on Monday September 29, 2014 @03:37PM (#8384784)
Like what? Generics?
Re:Why There Is Interface Pollution in Java 8 by frowaway001 on Sunday September 28, 2014 @07:54PM (#8381228)
Oh, what a surprise, pron is doing his FUD thing again.
Re:Why There Is Interface Pollution in Java 8 by pron on Monday September 29, 2014 @06:37AM (#8382294)
I realize you're trolling, but let me try to explain this (hopefully for the last time): I can certainly understand why people don't like -- or don't choose to use -- the languages I choose to use (Clojure, Java, C). Hell, I can give you some very serious criticism against them myself (Java can become tedious to write, especially if you're working on relatively boring problems, and this might lead to demoralization, which is a very serious issue; in the past couple of years Clojure is also turning its attention to cleverness rather than getting things done, it's also not obvious how to construct and maintain a large-scale project in Clojure, and its syntax is a real turnoff to many developers; C's simplicity often comes at the expense of basic abstractions, like polymorphism, that actually assist in maintaining large codebases and dividing up work among developers, its concurrency story is severely lacking, and its security is terrible). So if someone tells me those languages aren't for them -- for example, hiring young developers and keeping them enthusiastic by using a clever language is more important to them than long-term maintenance of the project -- I get that, I really do.

I also understand that you think it would be a wise decision on the part of Bank of America to write their software in Scala, or Raytheon to choose Scala for their aircraft carrier's C3I system; maybe you believe that a more expressive type system will lead to fewer bugs in such large systems, or that fewer lines of code offset its cleverness. You might think that the extreme lengths taken to ensure you never have to cast a type during collection transformations isn't PL-research showmanship that comes at the expense of code readability and getting stuff done, but a wise bug-preventing measure. But you should realize that people criticize your favorite language(s) for valid reasons. Maybe they have different constraints from yours, and maybe they favor other tradeoffs. Especially given that Scala -- unlike Java, Swift or Go -- was never meant to be "a language for everyone" (and neither is Clojure), it should come as no surprise that not everyone likes it, and for good reasons. Why, those reasons were deliberate! What I find annoying is trying to disown those decisions, deny those tradeoffs, and pretend Scala was a language designed not by professors and PhD students but by industry veterans. Both are, of course, excellent candidates for language design (look at Erlang and Haskell), but each group would choose different tradeoffs, and the languages they produce reflect that. Personally, I think "PL research" languages pave the path to the future and influence "industry" languages, but are often the wrong choice for serious industry projects. Going back to Erlang and Haskell, they're an interesting example because both try to solve kind of the same issues, and they're both superb languages; still, if the CTO of an airport asked me which language to use for their next critical system, I wouldn't hesitate before recommending Erlang and warning -- quite strongly, in fact -- against choosing Haskell.

Re:Why There Is Interface Pollution in Java 8 by tome on Monday September 29, 2014 @08:57AM (#8382689)
> I wouldn't hesitate before recommending Erlang and warning -- quite strongly, in fact -- against choosing Haskell

That's a very unequivocal conclusion but you didn't say anything about the reason for such a decision. Could you say a few words about that?

Re:Why There Is Interface Pollution in Java 8 by pron on Monday September 29, 2014 @11:28AM (#8383323)
I'll try to give a short answer, but suppose for the purpose of this discussion that Haskell and Erlang both address the project's initial code concerns equally well. Large, dependable projects, with a long projected usage, have some general requirements that are well-known and tend to be the same for most of them. They include ease of training, ease of hiring, ease of reading and modifying other people's code, ease of upgrade, ease of debugging, ease of profiling, ease of monitoring running software and more. In short, ease of maintenance. Languages built by the industry and designed and used by industry tend to put a lot of emphasis on this, while languages built in academia tend to care more about language expressiveness, code reuse (through graceful abstractions) etc.. Those are important things that matter to the industry too, but not nearly as much as the ones I mentioned. Because language maintainers have limited resources, often one set of requirements comes at the expense of the other. Sometimes the concerns in the latter group can even directly conflict with those in the first; for example, powerful abstractions can become too clever, hard to learn, and hard to understand by reading the code (I think this might be the case with Haskell, but not necessarily so for any hypothetical "academic" language).
Re:Why There Is Interface Pollution in Java 8 by tome on Monday September 29, 2014 @12:47PM (#8383709)
Thanks for that!
Re:Why There Is Interface Pollution in Java 8 by llemiengre on Monday September 29, 2014 @08:09AM (#8382522)
Your criteria make it impossible to use a language that came 'out of academia'. The problem is of course that there is no serious jvm language that can really fill the niche that scala has created. If you look at the top libraries/frameworks that are build on top of Scala: akka, play, lift, slick, spark they are radical improvements if you compare them with their java counterparts (if they exist), they deal with very hard problems and manage to make the problem significantly easier to handle.

btw, these libraries are developed by industry veterans & all of them have commercial support. For success stories go here: https://typesafe.com/company/casestudies

Re:Why There Is Interface Pollution in Java 8 by pron on Monday September 29, 2014 @11:40AM (#8383399)
> Your criteria make it impossible to use a language that came 'out of academia'.

Well, it would be silly to make such a broad, and hypothetical generalization, but as far as the "academic" languages I've seen, let's say a lot of caution is required before adoption in the industry. See my answer to tome.

> If you look at the top libraries/frameworks that are build on top of Scala...

While I can dispute your claim about most of the libraries you've mentioned, I can wholeheartedly agree that some Scala libraries provide much prettier APIs than Java libraries can. Still, the same can be said about C++ APIs vs. C APIs, and in spite of their elegance, a lot of large projects wish they had stuck with uglier C APIs, because most benefits come with costs attached. I'm not saying that Scala doesn't have any benefits -- it's got plenty. I'm just saying that in the case of Scala, its costs far outweigh its benefits.

The interesting question to me is, can we extract some of the goodness Scala brings without paying so dearly for it? The question is yet to be answered satisfactorily, but I think languages like Kotlin (or Swift, which, from what I've seen, looks very similar to Kotlin) show that this might indeed be possible.

Re:Why There Is Interface Pollution in Java 8 by pkinsky on Monday September 29, 2014 @10:37AM (#8383004)
> You might think that the extreme lengths taken to ensure you never have to cast a type during collection transformations isn't PL-research showmanship that comes at the expense of code readability and getting stuff done, but a wise bug-preventing measure.

This is a complete caricature of the benefits of type-safe languages. Why should anyone engage with you when you can't be bothered to look into the (claimed) benefits of what you're arguing against?

Re:Why There Is Interface Pollution in Java 8 by frowaway001 on Monday September 29, 2014 @10:22AM (#8382926)

  1. If you could manage to make a single point without
     using multiple strawmen and sweeping generalizations, 
     people would take you more seriously.

  2. Just read your own text. You have made up your mind 
     (perfectly fine), but you are desperately making up 
     arbitrary claims to fit your own view (increasingly 
     ridiculous).

  3. Additionally, you are completely unable to refer to 
     specific instances of what you think is wrong and only 
     respond with abstract platitudes which could include 
     everything or nothing.

  4. Reading a bit about Scala on the Internet and 
     repeating it doesn't make you an expert.
That's the issue.
Re:Why There Is Interface Pollution in Java 8 by pron on Monday September 29, 2014 @11:08AM (#8383205)
You can dismiss my claims (hey, I'm just expressing my opinion), but to make one point clear: I have over 20 years experience writing software professionally (yeah, I got my first paid programming gig at a relatively young age), and I've been following Scala since its initial release. A few years ago I tried switching my project's team from Java to Scala, and the results of the experiment were very negative. True, my hands-on Scala experience (which was rather comprehensive at the time) ended several years ago, but much has changed for the worse since then, though some has changed for the better in the past few years. I don't need to try and switch a ten people team to Scala with every major version in order to make valid claims. What killed us then was that Scala was posing as "a better Java" -- less boilerplate etc. -- while in fact it was "a more complex Haskell, minus all the constraints which make Haskell safe" (in addition there were serious compatibility issues and more). We found that Scala code was less readable, and getting people to understand other people's code was a lot harder than in Java. In short, the language was the exact opposite of what a large scale, dependable project required, so we ended the experiment. Since then, Scala has gotten a lot more complex with even more features.

Also, your insistence that Scala isn't a research language is based on... I don't know what. Unlike, say, Clojure or Erlang, that tried to solve specific software engineering pain points (state management, fault tolerance), Scala started as a research language designed to test a PL hypothesis: how well can FP and OOP mesh, and will doing so be helpful. It also experimented with advanced type systems, and recently with statically typed language. None of the motivations behind these features was an industry problem. No one in the industry said, "you know what, type safe macros is what's going to make our automation control software easier to maintain". Their motivation came from conjectures compiler writers had about novel language features and how they might be used when writing a piece of code. You can deny this all you want, but those are facts. What is opinion is the analysis of the result: I claim that the result is a kitchen-sink language with too many features -- most of them marginally useful when building the next stock-market exchange -- and all of them contribute complexity whose cost far exceeds its benefit, resulting in a language whose net contribution to industry projects (not research projects) is negative. Feel free to disagree. If you think valid claims only pertain to the discussion of the for comprehension syntax, then you should try managing large projects and see that it's the philosophy of the language and combination of features that matters.

Re:Why There Is Interface Pollution in Java 8 by frowaway001 on Monday September 29, 2014 @03:37PM (#8384782)
This is not about disagreement.

You keep making huge claims and sweeping generalizations based on a completely irrelevant version of Scala ("a few years ago" == "not a version which would give any useful information to judge Scala today"), without being able to support any of it with even a glimpse of detail.

At the same time, you come up with requirements where there is just no chance to actual fulfill them, e. g. bashing the language for both being not production-ready before 2.8 (is that even a point worth discussing?) and for rapidly improving on exactly these issues (OMG!!! It is changing too fast!).

I think you should really make your mind up on these things, because you can't have it both ways.

I'm saying this because this incoherent reasoning is constantly happening in your comments, it's not some isolated case.

Re:Why There Is Interface Pollution in Java 8 by pron on Monday September 29, 2014 @04:46PM (#8385205)
> without being able to support any of it with even a glimpse of detail.

I'm sorry, but you're just not getting it. I don't take issue with Scala's choice of square brackets over angled brackets. I take issue with the language philosophy and combined set of features. Here are the most detailed details: too many features, many of them overlapping (traits, structural types); too much complexity (type system, implicits); less readable; not enough constraints (e.g. immutability not enforced, casts allowed everywhere). That's as detailed as it gets. All in all, it came out benefits << cost. That's it.

Either you don't want to understand or you think that when Boeing wants to write some big aircraft software thingy they say, "hmmm., the type inference is insufficient for our needs", or, "if only we had non-strict evaluation...". Because that's not how it works. In the industry languages are evaluated as a whole based on the project's criteria, with all their combined benefits weighed against their combined costs. This is what we've done. Scala came out lacking: too much overall cost for too little overall benefit. It was too complicated, too unconstraining, too unreadable, and too difficult to upgrade and build. What more do you want?

> "not a version which would give any useful information to judge Scala today"

No, I'm sorry, but you're just plain wrong! I gave up on Scala some years ago, but I can still tell its evolution has been in the opposite direction from what we wanted. Since then the language has become even bigger, more complex, more obtuse (collections) and even less constraining (macros). Even if the build and upgrade issues are better, the PL research philosophy is still there and its effects are only worse than they were some years ago.

Re:Why There Is Interface Pollution in Java 8 by frowaway001 on Monday September 29, 2014 @06:51PM (#8385800)
This is so wrong, that I kind of start thinking you never even touched the language.
Re:Why There Is Interface Pollution in Java 8 by pron on Monday September 29, 2014 @08:07PM (#8386079)
And I wish I hadn't :) Just kidding. I don't think it's that terrible. And it does have some nice features that other, more industry-oriented languages have selectively adopted -- and will adopt in the future. I just find it utterly inappropriate for the kind of applications we're discussing.
Re:Why There Is Interface Pollution in Java 8 by llemiengre on Monday September 29, 2014 @05:06AM (#8382137)
As much as I would like to like technologies like quasar & pulsar, having a guy like pron work on it is enough to scare me away.

Bashing the competition with FUD is never acceptable for me.