News for hackers. Stuff that matters.
Re:Why Java Now Rocks More Than Ever: Part 1 – The Java Comp... by RivieraKid on Monday October 07, 2013 @12:18PM (#6509236)
> Honestly: use something better for a while and come back and say that.

I've written code in about 20 different languages.

What language features / lack of features do you think make Java verbose?

I found Scala complex and ugly (and I'm not alone), much slower to compile than Java and Java has better tooling.

Re:Why Java Now Rocks More Than Ever: Part 1 – The Java Comp... by eropple on Monday October 07, 2013 @12:51PM (#6509492)
- No pattern matching. This alone basically makes the rest of this list just piling on; once you have 'gotten' pattern matching, Java (and, to be fair, most other popular languages) becomes intolerable.

- Lack of even halfassedly reified generics means you're throwing Class objects around everywhere for no good reason. (Scala adds manifests as implicit parameters and it's not as good as .NET but it's a hell of a lot better than Java.)

- Actually, let's just go with "the type system in general". For being built upon the same shitty tools as Java, they do a lot to provide an environment where thinking about types isn't prohibited.

- Inner classes being used for nontrivial things (see also: all of Android, saved only by AndroidAnnotations; all of Swing, saved only by never having to use it).

- No comprehensions. Nuff said.

- Null by default. Option types are both safer and easier to work with functionally than imperative null boilerplate.

- Nonfunctional control constructs. For example, 'if' being a functional construct makes tons of code simpler and easier to read.

- No default parameters. Dumb. Whenever they get them I'm sure it will be something less expressive than Scala's (something like "must be resolvable at compile-time") because doing otherwise will be hard.

- Braces everywheeeeere. The ability to go "def foo() = someFunc(localVar)" is awesome. Less bullshit, more code.

- Interfaces suck when traits exist. The idea that I need to write wireup code when I have getBar and getBars methods (because any sane person will implement getBar as a hat on top of getBars with a singleton list) is utterly stupid.

- Nonfunctional core APIs (where's my map/filter/fold?) that think mutability is a good thing. Guava tries to help, but it's bolting onto a fairly stupid List/Iterable core pattern.

- Reference-reseating-by-default means doing it right adds foolish 'final' keywords everywhere.

- Private visibility (or, to be specific, not-really-private, WTF?) by default means you will be splattering 'public' everywhere, too. This and the last two combine to make objects full of weird action just for funsies; if everything's immutable by default, the cases where you need 'private' to not blow up the world shrink immensely.

- Keywords and methods where operators make sense. List.add() is derpy. "T extends SomeClass" is a traveshamockery. We're programmers, computer science should not be that foreign, there are mathematical symbols to express this in type theory--so use them, as Scala does (I'd rather they used "<." instead of "<:", but I understand why they don't).

.

Scala is complex. Nobody said it's not. But it's complex because it's expressive. It's a predictable language with expressive semantics that doesn't make you do stupid shit to get things done. The tooling has reached a point where I no longer notice it and while it is slower to compile than Java, so is C++ and that doesn't bother me either because what I get is better at what it does.

I don't much care for the look of Python, but it's better and more suited to some tasks and so I get over it and use it. You may find Scala "ugly" and I'm sure you can find plenty of entrenched Java developers to agree with you, but outside of the epistemic Blub-closure of the Java world it is rapidly becoming understood that Java is better at nothing by design.

Re:Why Java Now Rocks More Than Ever: Part 1 – The Java Comp... by RivieraKid on Monday October 07, 2013 @01:26PM (#6509743)
- Type erasure - true but it results in a very small increase in overall verbosity.

- Null - true but Scala's approach is perhaps more verbose than Java's. I like Groovy's approach the most ().

- Functional if - definitely disagree that it makes tons of code simpler / easier to read.

- Java 8 has traits (but I'm not sure if they're equivalent to Scala's traits).

- Nonfunctional core API's – Guava helps here.

– Reference-reseating-by-default - don't know what you mean by that.

I don't think Scala is the next Java. Personally, I wish Kotlin, Ceylon or Dart would replace Java. Scala makes the wrong expressivness / simplicity tradeoff.

> outside of the epistemic closure of the Java world it is rapidly becoming understood that Java is better at nothing by design

Not true. Yammer moved back from Scala to Java: http://blog.joda.org/2011/11/real-life-scala-feedback-from-y...

Re:Why Java Now Rocks More Than Ever: Part 1 – The Java Comp... by eropple on Monday October 07, 2013 @01:45PM (#6509886)
Yammer did no such thing (and it's telling that you're sourcing a two-year-old article that misrepresents the situation under discussion): http://eng.yammer.com/scala-at-yammer/

And Scala isn't the next Java. Frankly, it isn't simple enough to appeal to people who have become comfortable; it isn't unchallenging enough to supplant Java. This is not a demerit.

Re:Why Java Now Rocks More Than Ever: Part 1 – The Java Comp... by RivieraKid on Monday October 07, 2013 @02:03PM (#6509999)
Right now at Yammer we're moving our basic infrastructure stack over to Java, and keeping Scala support around in the form of façades and legacy libraries.

The link you provided doesn't contradict that.

Language can be too simple or too complex. The tradeoff that gives maximum productivity is somewhere in the middle. And in my opinion, languages like Dart or Ceylon are much closer to the optimum than Scala.

Re:Why Java Now Rocks More Than Ever: Part 1 – The Java Comp... by eropple on Monday October 07, 2013 @02:20PM (#6510134)
I don't think you've done anything to substantiate the claim that it's "too complex"; forgive my skepticism but I've spent enough time in both the Scala and C++ communities to draw a significant line between "too complex" and "critic hasn't learned it sufficiently" (and I've been on both sides of that line).

I have spent a nontrivial amount of time with Kotlin and Ceylon and neither are particularly interesting to me after actually internalizing and understanding Scala; as an example, I am significantly hampered by their continued insistence on mutable-everywhere (which is basically the watchword for "barely adequate programmer"). They may very well be "the next Java", but that's a curse more than a compliment. You should not need Guava to write minimally competent code.

Meanwhile, as a sibling comment notes, Twitter's a lot bigger than Yammer and pretty vocal about going whole-hog on Scala (and I've talked to them a little about what they've done, it's insanely impressive, I'm jealous). Guess they're just making things hard on themselves for no reason though.

Re:Why Java Now Rocks More Than Ever: Part 1 – The Java Comp... by RivieraKid on Tuesday October 08, 2013 @11:26AM (#6515577)
Linus Torvalds is in the C++ is too complex camp too AFAIK :)

I believe that Ceylon is the best-designed general purpose language out there. What do you mean by "mutable-everywhere"? Ceylon's variables / attributes are immutable by default.