The Artima Developer Community
Sponsored Link

Artima Developer Spotlight Forum
Java is Dead, But You'll Learn to Love It

27 replies on 2 pages. Most recent reply: Oct 16, 2009 10:05 AM by John Zabroski

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 27 replies on 2 pages [ « | 1 2 ]
James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Java is Dead, But You'll Learn to Love It Posted: Oct 7, 2009 9:02 AM
Reply to this message Reply
Advertisement
> I'm also regularly frightened by the snippets of code that
> I read on a daily basis on the Scala mailing-list. Maybe
> this should not come as a surprise since the list is meant
> to investigate and elucidate the dark corners of Scala,
> but I never had this problem with the Fan mailing-list.

I think the Scala community may be one of it's weaknesses. There are some scary smart people on that mailing list but there seems to be a focus on really esoteric and often academic concerns that bread-and-butter developers are only interested in casually, if at all. This kind of group can turn people off and lead a language into the weeds.

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: Java is Dead, But You'll Learn to Love It Posted: Oct 7, 2009 10:03 AM
Reply to this message Reply
Hi Cedric,

>
> While there are a few features that I'm not very fond of
> and that I documented on my blog (namely, implicits,
> matching and structural typing), each individual feature
> of Scala sounds great on paper, and I mean that literally
> (I quite enjoyed your book for that reason). I think that
> what makes Scala difficult is the combinatorial explosion
> of all these features, especially when you start using
> Scala's generic type system extensively.
>
I assume you're talking about my book. Frank's book (on Actors) will be out soon, but hasn't been released yet. I did work very hard to make the code in that book look readable and beautiful, in part because I wanted to make an tastefully typeset book for Artima's first book, but also because I knew this was a marketing document. If the code looked ugly and inscrutable in Martin Odersky's Scala book, it would turn people off to Scala. And if it was beautiful to look at, it would help make people feel good about Scala.

> I have browsed quite a bit of Scala source code of big
> projects to get a feel for what Scala looks like in the
> trenches, and I was quite disappointed to see that all the
> neatness that I found in your book is gone. All the
> compactness and functional beauty that Scala seems to make
> so easy to generate disappears to be replaced by hardcore
> C-like thick code. Even closures and matching become
> difficult to read.
>
I've seen both. I've seen Scala code that is ugly and scary, and I've seen Scala code that is refreshingly easy to read. (One example is I thought Robey Pointer's Configgy code (on GitHub I think) was quite easy to read when he showed it at one of the ScalaBASE meetings.) What I think is a very valid critique and concern about Scala is that it does give people more rope to shoot themselves in the foot with compared to Java and Fan. Though I'd say this has more to do with the flexibility of the Scala language than its complexity.

I tried in the book to warn people against abuse of implicit conversions and operators, and to encourage a functional style. I also with ScalaTest am trying to encourage these values by example. I'll be writing some blog posts illustrating what I did in ScalaTest in this regard, but people will do what they do. One hopeful thing is that the library designer has a lot of say in Scala about how the client code looks, so it will help if we can get libraries that encourage readable client code adopted. But ultimately, I expect the ugly Scala code will always be with us, along with the pretty code.

Ben Keeping

Posts: 1
Nickname: benkeeping
Registered: Oct, 2009

Re: Java is Dead, But You'll Learn to Love It Posted: Oct 7, 2009 11:33 AM
Reply to this message Reply
I've only been writing Scala for a few months, but I find the power of the language compared to Java is nothing short of remarkable. It makes me not want to write anything in Java anymore.
Our shop is a fairly equal split of C# and Java (=> Scala), and few a while now I was jealous of the functional features .net 3.5 brought in - closures and such.
Java has been in effect syntactically stagnant for so long now, that I was beginning to write it off even as a platform.
For me, Scala has breathed fresh life into Java-as-a-platform, by doing the things Java-as-a-language should have done.

Change is good - not breaking things because people might say "you broke my code when I upgraded to the next Java version" is not IMO a valid opinion. Yes, you want stability in general, but sometimes you've got to break it to move on. Which is what Scala has done.

As for grim Scala code - bad developers will write bad code whatever language they use. Just because Scala has the power to write crazy looking code, doesn't mean you have to write that style every day. Often it doesn't fit, sometimes it does.
A concrete example is an attempt to make JDBC a bit easier. I can't stand writing boiler-plate JDBC code, but sometimes JDBC fits instead of an ORM like Hibernate, but a Scala-ification of JDBC means JDBC becomes easy to read and more importantly concise.
Now, the Scala code to do this is a bit scary, and I would not want to read code like that all day, but its an example of when the power of "scary-Scala" can leverage some endpoint simplicity to the user-programmer.
See http://scala.sygneca.com/code/simplifying-jdbc (I didn't write that, but love using it !)

BTW Bill Venners et al, loved your book, read it every day :)

Kay Schluehr

Posts: 302
Nickname: schluehk
Registered: Jan, 2005

Re: Java is Dead, But You'll Learn to Love It Posted: Oct 7, 2009 12:18 PM
Reply to this message Reply
> I think Fan (http://fandev.org/) is shaping up to become a
> very interesting compromise between Java and Scala, and
> the recent announcement of an Eclipse plug-in is making me
> even more enthusiastic about it.

Given Fan's feature set I wouldn't be too surprised when we encounter a C# 4 implementation on the JVM in 2011. At least this had some poetic irony.

John Zabroski

Posts: 272
Nickname: zbo
Registered: Jan, 2007

Re: Java is Dead, But You'll Learn to Love It Posted: Oct 8, 2009 9:09 AM
Reply to this message Reply
> I haven't use Scala enough to know how it really fills,
> but I find big languages scary. I was looking at Felix the
> other day, which contains everything: object oriented
> programming, functional programming, compile-time
> programming, an open grammar, garbage collection, multiple
> dispatch, etc...in theory, it sounds nice, but in
> practice, it seems scary. Felix is around for a few years,
> but I've never heard being used anywhere.

Achilleas,

Do you think it is possible to have all the qualities of Felix and keep things small?

John Zabroski

Posts: 272
Nickname: zbo
Registered: Jan, 2007

Re: Java is Dead, But You'll Learn to Love It Posted: Oct 8, 2009 9:16 AM
Reply to this message Reply
>
> I'm also regularly frightened by the snippets of code that
> I read on a daily basis on the Scala mailing-list. Maybe
> this should not come as a surprise since the list is meant
> to investigate and elucidate the dark corners of Scala,
> but I never had this problem with the Fan mailing-list.

The Fan docs confuse me, to be honest.

I saw "REST" advertised on the front page, and it linked to an API talking about this "oBIX" OASIS standard I'd never heard of. It wasn't clear how this was "REST".

In short, I prefer well-designed libraries to good languages. An enthusiastic community is important, too: Technically, Mono is a better platform than KDE, but KDE 4.x is moving faster than GNOME has in years.

Common Lisp is a simple language with killer libraries. Clojure is even simpler, but lacks killer libraries at the moment.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Java is Dead, But You'll Learn to Love It Posted: Oct 8, 2009 9:39 AM
Reply to this message Reply
> I haven't use Scala enough to know how it really fills,
> but I find big languages scary. I was looking at Felix the
> other day, which contains everything: object oriented
> programming, functional programming, compile-time
> programming, an open grammar, garbage collection, multiple
> dispatch, etc...in theory, it sounds nice, but in
> practice, it seems scary. Felix is around for a few years,
> but I've never heard being used anywhere.

I kind of agree with you here. I think that what's more important is how hard it is to become comfortable (less scared) of the features of the language. I don't buy the argument that it's OK to just know some features. That's only OK for those being mentored or exploring a language.

Sidebar- please don't read too much into this. I don't mean to say that every developer needs to know every corner case of a language.

Dick Ford

Posts: 149
Nickname: roybatty
Registered: Sep, 2003

Re: Java is Dead, But You'll Learn to Love It Posted: Oct 8, 2009 11:15 AM
Reply to this message Reply
> In short, I prefer well-designed libraries to good
> languages. An enthusiastic community is important, too:
> Technically, Mono is a better platform than KDE, but KDE
> E 4.x is moving faster than GNOME has in years.
>

"Technically", that's a matter of opinion. But in any case, you seem to be confused about the relationship between Mono and Gnome. The base Gnome dependency libraries aren't written in Mono.

> Common Lisp is a simple language with killer libraries.
> Clojure is even simpler, but lacks killer libraries at
> t the moment.

I think you have that backwards. Clojure runs on the JVM and its interop with Java is pretty seamless.

John Zabroski

Posts: 272
Nickname: zbo
Registered: Jan, 2007

Re: Java is Dead, But You'll Learn to Love It Posted: Oct 8, 2009 11:52 AM
Reply to this message Reply
>
> "Technically", that's a matter of opinion. But in any
> case, you seem to be confused about the relationship
> between Mono and Gnome. The base Gnome dependency
> libraries aren't written in Mono.
>


Moonlight is backed by GTK and thus the GNOME object model. It is still the same underlying API under the covers. Even with Moonlight's newer API, Novell is at the mercy of Microsoft's RAD-based API preferences. "Fire and Motion"; by the way, I love Silverlight, but I am afraid MS customers demand it get turned into the bloated, hard-to-debug hell that is the too-clever-by-half WPF.

Where GNOME has forever held the advantage over KDE is sane usability experts, instead of being led by KDE's Celeste Paul. KDE's usability team needs better community leadership.

Mono brings things to the table that long-term I don't see KDE supporting well, though.

>
> I think you have that backwards. Clojure runs on the JVM
> and its interop with Java is pretty seamless.

They're not written in Clojure. These libraries are also not especially simple. The JVM's strongsuit is its concurrency data structures, which dominate Mono/.NET. In .NET, you have the PowerCollections and C5 libraries, which both sort've aren't ideal.

Dick Ford

Posts: 149
Nickname: roybatty
Registered: Sep, 2003

Re: Java is Dead, But You'll Learn to Love It Posted: Oct 8, 2009 1:02 PM
Reply to this message Reply
> Mono brings things to the table that long-term I don't see
> KDE supporting well, though.
>

We're getting pretty offtopic here, but the chance of Mono being an underlying base technology for Gnome proper in the future is slim and none. Therefore the tie-in between Mono/Gnome and the comparison to KDE isn't valid.


> >
> > I think you have that backwards. Clojure runs on the
> JVM
> > and its interop with Java is pretty seamless.
>
> They're not written in Clojure. These libraries are also
> not especially simple.

But back to the comparison of CL and Clojure. It's a lot easier to "clojurify" a Java library, then it is to write it from scratch. But many CL libraries tend to be fairly crufty just for the mere fact that the community is small.


But I'll post something on topic while I'm here. The thing that is missing from all these discussions is that unless you have a major player (IBM, Oracle..) in the Java world backing Scala or Groovy, you'll never see this "official" successor to Java (the language).

Anyway, I'm with Kate on this. Port C# 4.0 to the JVM and call it a day. Scala is too weird for the average developer, and I don't think any dynamically-typed language (Groovy) will be a successor to Java (even if Groovy is almost to Java what C++ is to C).

John Zabroski

Posts: 272
Nickname: zbo
Registered: Jan, 2007

Re: Java is Dead, But You'll Learn to Love It Posted: Oct 8, 2009 2:08 PM
Reply to this message Reply
> Port C# 4.0 to the JVM and call it a day.

Not a huge fan of 4. The dynamic feature is really meant for COM interop, and IME java guys don't use JNI much. There are many situations where using it breaks down, such as generic constraints.

Also:
No improved support of literals (hashes, lists, arrays, xml).
No lambda expression assignment for events.

The big additions are all orthogonal to C# itself.

Concurrency. Parallelism. SpecSharp. BCL Contracts.

The compiler services have been in Mono for awhile and have a better toolchain.

Achilleas Margaritis

Posts: 674
Nickname: achilleas
Registered: Feb, 2005

Re: Java is Dead, But You'll Learn to Love It Posted: Oct 9, 2009 3:50 AM
Reply to this message Reply
> > I haven't use Scala enough to know how it really fills,
> > but I find big languages scary. I was looking at Felix
> the
> > other day, which contains everything: object oriented
> > programming, functional programming, compile-time
> > programming, an open grammar, garbage collection,
> multiple
> > dispatch, etc...in theory, it sounds nice, but in
> > practice, it seems scary. Felix is around for a few
> years,
> > but I've never heard being used anywhere.
>
> Achilleas,
>
> Do you think it is possible to have all the qualities of
> Felix and keep things small?

I really can't tell you that, I am not qualified enough to answer that question. Probably not. But before answering that question, here is another question to answer: do we really need all this functionality?

John Zabroski

Posts: 272
Nickname: zbo
Registered: Jan, 2007

Re: Java is Dead, But You'll Learn to Love It Posted: Oct 16, 2009 10:05 AM
Reply to this message Reply
> > Achilleas,
> >
> > Do you think it is possible to have all the qualities
> of
> > Felix and keep things small?
>
> I really can't tell you that, I am not qualified enough to
> answer that question. Probably not. But before answering
> that question, here is another question to answer: do we
> really need all this functionality?

In my humble opinion, the thing with features to be careful of is prematurely using a valuable sigil or keyword to something that won't be used often. For example, how often do you really need to treat a value type as a reference type, and vice versa? For this I'd rather not use a shorthand notation like pointer syntax and derefencing, especially in an object-oriented system where everything is objects all-the-way down.

Flat View: This topic has 27 replies on 2 pages [ « | 1  2 ]
Topic: JetBrains Open Sources IntelliJ IDEA Community Edition Previous Topic   Next Topic Topic: Simplifying Java Code with Google Collections, Guava, and Static Imports

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use